Create a new custom metric
curl --request POST \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metric": {
"key": "<string>",
"description": "<string>",
"options": [
"<string>"
],
"isSystem": true
}
}
'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics"
payload = { "metric": {
"key": "<string>",
"description": "<string>",
"options": ["<string>"],
"isSystem": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric: {
key: '<string>',
description: '<string>',
options: ['<string>'],
isSystem: true
}
})
};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metric' => [
'key' => '<string>',
'description' => '<string>',
'options' => [
'<string>'
],
'isSystem' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics"
payload := strings.NewReader("{\n \"metric\": {\n \"key\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"isSystem\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metric\": {\n \"key\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"isSystem\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metric\": {\n \"key\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"isSystem\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"metricId": "<string>",
"metric": {
"id": "<string>",
"key": "<string>",
"description": "<string>",
"isSystem": true,
"options": [
"<string>"
],
"createdAtUNIX": 123,
"updatedAtUNIX": 123
}
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Custom Metrics
Create Custom Metric
Create a new custom metric for tracking agent-specific data
POST
/
agents
/
{agentId}
/
custom-metrics
Create a new custom metric
curl --request POST \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metric": {
"key": "<string>",
"description": "<string>",
"options": [
"<string>"
],
"isSystem": true
}
}
'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics"
payload = { "metric": {
"key": "<string>",
"description": "<string>",
"options": ["<string>"],
"isSystem": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric: {
key: '<string>',
description: '<string>',
options: ['<string>'],
isSystem: true
}
})
};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metric' => [
'key' => '<string>',
'description' => '<string>',
'options' => [
'<string>'
],
'isSystem' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics"
payload := strings.NewReader("{\n \"metric\": {\n \"key\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"isSystem\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metric\": {\n \"key\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"isSystem\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metric\": {\n \"key\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ],\n \"isSystem\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"metricId": "<string>",
"metric": {
"id": "<string>",
"key": "<string>",
"description": "<string>",
"isSystem": true,
"options": [
"<string>"
],
"createdAtUNIX": 123,
"updatedAtUNIX": 123
}
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Overview
Creates a new custom metric that can be tracked during agent conversations. Metrics enable you to measure and analyze specific data points relevant to your business.Metric Types
Number
For quantifiable metrics like ratings, counts, or durations.{
"metric": {
"key": "customer_satisfaction",
"description": "Customer satisfaction rating (1-10)",
"type": "number"
}
}
Boolean
For yes/no questions or binary states.{
"metric": {
"key": "issue_resolved",
"description": "Whether the customer's issue was resolved",
"type": "boolean"
}
}
Enum
For predefined categorical options.{
"metric": {
"key": "sentiment",
"description": "Customer sentiment analysis",
"type": "enum",
"options": ["positive", "negative", "neutral"]
}
}
Enum type metrics must include an
options array with at least one value.String
For open-ended text responses.{
"metric": {
"key": "feedback",
"description": "Customer feedback comments",
"type": "string"
}
}
Key Guidelines
- Metric keys must be unique per agent
- Keys should be descriptive (e.g.,
customer_satisfactionnotcs) - Keys are case-sensitive
- Maximum key length: 100 characters
Common Use Cases
- NPS Score: Track Net Promoter Score
- Resolution Time: Measure average time to resolve issues
- Sentiment Analysis: Categorize conversation sentiment
- Lead Quality: Score lead quality (1-5)
- Product Interest: Track which products customers ask about
After creating a metric, your agent will automatically start tracking it during conversations where the information is available.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the agent
Body
application/json
Show child attributes
Show child attributes
⌘I
