Delete a custom metric
curl --request DELETE \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>"
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Custom Metrics
Delete Custom Metric
Delete a custom metric from an agent
DELETE
/
agents
/
{agentId}
/
custom-metrics
/
{metricId}
Delete a custom metric
curl --request DELETE \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>"
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Overview
Permanently deletes a custom metric definition from an agent. This stops the metric from being tracked in future conversations.Important:
- This action cannot be undone
- Historical data is not deleted - past metric values remain in conversation records
- The metric will no longer be tracked in new conversations
- System metrics cannot be deleted
What Happens After Deletion
- ✅ Historical Data Preserved: All previously recorded metric values remain in conversations
- ✅ Analytics Access: You can still query historical data for this metric
- ❌ Future Tracking Stops: The metric won’t be collected in new conversations
- ❌ Metric Not Listed: The metric disappears from the metrics list
System Metrics Protection
System metrics are protected and cannot be deleted:{
"error": {
"code": "FORBIDDEN",
"message": "System metrics cannot be deleted"
}
}
Alternative: Disable Instead of Delete
If you want to temporarily stop tracking a metric without losing its definition:Consider creating a “disabled” or “archived” state in your application instead of deleting metrics. This preserves the configuration for potential future reactivation.
Use Cases
- Cleanup: Remove outdated or unused metrics
- Reorganization: Clear metrics before implementing a new tracking strategy
- Mistake Correction: Remove incorrectly configured metrics
Before Deleting
- Export Data: Back up historical data if needed
- Update Documentation: Remove references to the metric from internal docs
- Notify Team: Inform team members who rely on this metric
- Check Dependencies: Ensure no dashboards or reports depend on this metric
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the agent
The unique identifier of the metric to delete
