Skip to main content
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>",
    "type": "number",
    "options": [
      "<string>"
    ],
    "isSystem": true
  }
}
'
{
  "success": true,
  "message": "<string>",
  "metricId": "<string>",
  "metric": {
    "id": "<string>",
    "key": "<string>",
    "description": "<string>",
    "type": "number",
    "isSystem": true,
    "options": [
      "<string>"
    ],
    "createdAtUNIX": 123,
    "updatedAtUNIX": 123
  }
}

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_satisfaction not cs)
  • 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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required

The unique identifier of the agent

Body

application/json
metric
object
required

Response

Successful response

success
boolean
required
message
string
required
metricId
string
required
metric
object
required