Skip to main content
PATCH
/
v1
/
metric
/
definitions
/
{metricId}
Update a metric definition
curl --request PATCH \
  --url https://api.roark.ai/v1/metric/definitions/{metricId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "llmPrompt": "<string>",
  "scaleMin": 50,
  "scaleMax": 50,
  "scaleLabels": [
    {
      "rangeMin": 123,
      "rangeMax": 123,
      "label": "<string>",
      "displayOrder": 123,
      "description": "<string>",
      "colorHex": "<string>"
    }
  ],
  "booleanTrueLabel": "<string>",
  "booleanFalseLabel": "<string>",
  "classificationOptions": [
    {
      "label": "<string>",
      "description": "<string>",
      "displayOrder": 123
    }
  ],
  "maxClassifications": 2,
  "toolDefinitionIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "supportedContexts": [
    "CALL"
  ],
  "formula": "<string>",
  "sources": [
    {
      "sourceMetricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sourceVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "changeReason": "<string>",
  "metricId": "<unknown>",
  "source": "<unknown>",
  "organizationId": "<unknown>",
  "projectId": "<unknown>",
  "outputType": "<unknown>",
  "scope": "<unknown>",
  "participantRole": "<unknown>",
  "calcType": "<unknown>",
  "supportsMultipleVariants": "<unknown>",
  "analysisPackageId": "<unknown>"
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "metricId": "<string>",
    "variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "versionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "calculationType": "PROVIDER",
    "type": "COUNT",
    "scope": "GLOBAL",
    "supportedContexts": [
      "CALL"
    ],
    "unit": {
      "name": "<string>",
      "symbol": "<string>"
    },
    "threshold": {
      "sourceMetricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "operator": "GREATER_THAN",
      "thresholdValue": "<string>",
      "aggregationMode": "EACH",
      "countThreshold": 123,
      "sourceParticipantRole": "AGENT",
      "sourceVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    },
    "formula": {
      "expression": "<string>",
      "sources": [
        {
          "sourceMetricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "sourceVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ]
    },
    "pattern": {
      "operation": "PATTERN_EXISTS",
      "windowMode": "<string>",
      "triggerCombinator": "AND",
      "triggers": [
        {
          "sourceMetricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "operator": "GREATER_THAN",
          "thresholdValue": "<string>",
          "sourceParticipantRole": "AGENT",
          "sourceVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ],
      "outcome": {
        "sourceMetricDefinitionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "operator": "GREATER_THAN",
        "thresholdValue": "<string>",
        "sourceParticipantRole": "AGENT",
        "sourceVariantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "windowBefore": 123,
        "windowAfter": 123
      }
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.roark.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Path Parameters

metricId
string
required

Body

application/json

Editable subset of a metric definition. Every update creates a new immutable version. Immutable fields (metricId, scope, outputType, calcType, …) are rejected with a 400.

name
string

New name (only for metrics whose name is editable)

Required string length: 1 - 100
llmPrompt
string

New LLM prompt (only for LLM_JUDGE metrics whose prompt is editable)

Maximum string length: 2000
scaleMin
integer

New scale minimum (SCALE output only)

Required range: 0 <= x <= 100
scaleMax
integer

New scale maximum (SCALE output only)

Required range: 0 <= x <= 100
scaleLabels
object[]

Replacement set of scale-range labels (SCALE output only)

booleanTrueLabel
string

New label for the true case (BOOLEAN output only)

booleanFalseLabel
string

New label for the false case (BOOLEAN output only)

classificationOptions
object[]

Replacement set of classification options (CLASSIFICATION output only)

Minimum array length: 1
maxClassifications
integer

New maximum number of classifications (CLASSIFICATION output only)

Required range: x >= 1
toolDefinitionIds
string<uuid>[]

Replacement set of scoped tool-definition ids (only for metrics whose tool scoping is editable)

supportedContexts
enum<string>[]

Replacement set of supported contexts. Omit to leave unchanged.

Minimum array length: 1
Available options:
CALL,
SEGMENT,
TURN
formula
string

New formula expression (FORMULA only). Pass sources alongside if the referenced metrics change.

Required string length: 1 - 500
sources
object[]

Replacement formula sources, required when formula changes the referenced metrics (FORMULA only).

changeReason
string

Optional free-text audit note recorded on the new version.

metricId
any
source
any
organizationId
any
projectId
any
outputType
any
scope
any
participantRole
any
calcType
any
supportsMultipleVariants
any
analysisPackageId
any

Response

The updated metric definition (with versionId advanced to the new version)

data
object
required

Metric definition data