Skip to main content
PUT
/
agents
/
{agentId}
/
custom-metrics
/
{metricId}
Update an existing custom metric
curl --request PUT \
  --url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/custom-metrics/{metricId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metric": {
    "key": "<string>",
    "description": "<string>",
    "type": "number",
    "options": [
      "<string>"
    ]
  }
}
'
{
  "success": true,
  "message": "<string>",
  "metric": {
    "id": "<string>",
    "key": "<string>",
    "description": "<string>",
    "type": "number",
    "isSystem": true,
    "options": [
      "<string>"
    ],
    "createdAtUNIX": 123,
    "updatedAtUNIX": 123
  }
}

Overview

Updates the configuration of an existing custom metric. You can modify the description, type, and options (for enum types).

Partial Updates

You only need to include the fields you want to update:
{
  "metric": {
    "description": "Updated description for the metric"
  }
}

Updating Enum Options

For enum type metrics, you can add or modify options:
{
  "metric": {
    "options": ["positive", "negative", "neutral", "mixed"]
  }
}
Important Considerations:
  • Changing the metric type may affect existing data interpretation
  • Historical data is not automatically converted when you change types
  • Duplicate keys are not allowed - the update will fail if the new key already exists

Use Cases

  • Refine Descriptions: Make metric descriptions clearer
  • Add Enum Options: Expand categorical options as needs evolve
  • Correct Typos: Fix mistakes in metric configuration
  • Update Metadata: Keep metric information current
System metrics (where isSystem: true) cannot be updated via the API.

Example: Expanding Options

{
  "metric": {
    "description": "Customer sentiment with granular options",
    "options": [
      "very_positive",
      "positive", 
      "neutral",
      "negative",
      "very_negative"
    ]
  }
}

Common Update Scenarios

Update Description Only

{
  "metric": {
    "description": "Updated: Customer satisfaction rating on a scale of 1-10"
  }
}

Update Key

{
  "metric": {
    "key": "customer_satisfaction_v2"
  }
}

Update Type

{
  "metric": {
    "type": "enum",
    "options": ["low", "medium", "high"]
  }
}
Before changing a metric’s type, consider creating a new metric instead to preserve historical data integrity.

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

metricId
string
required

The unique identifier of the metric to update

Body

application/json
metric
object
required

Response

Successful response

success
boolean
required
message
string
required
metric
object
required