Update a metric definition
Update the editable subset of a custom metric definition, addressed by its UUID or its stable slug. Only the supplied fields are changed; omitted fields are left unchanged. Every update creates a new immutable version; the response carries the advanced versionId. Immutable fields (scope, outputType, calcType, …) are rejected, and which fields are editable depends on the metric (e.g. derived metrics only allow name). Roark’s own metrics are rejected here: this endpoint edits the shared definition, which every workspace sees. To change one for your workspace alone, edit its variant with PUT /v1/metric/definitions//variants/, which forks it for you and leaves every other workspace on the original.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The metric definition's Roark ID (UUID) or its stable slug (e.g. customer_satisfaction).
Body
Editable subset of a metric definition. Every update creates a new immutable version. Immutable fields (slug, scope, outputType, calcType, …) are rejected with a 400.
New name (only for metrics whose name is editable)
1 - 100New LLM prompt (only for LLM_JUDGE metrics whose prompt is editable). A custom metric prompt must include a transcript variable such as {{transcript}} and {{world_context}}, which gives the judge the current date and time when it grades.
20000New scale minimum (SCALE output only)
0 <= x <= 100New scale maximum (SCALE output only)
0 <= x <= 100Replacement set of scale-range labels (SCALE output only)
New label for the true case (BOOLEAN output only)
New label for the false case (BOOLEAN output only)
Score this metric on a simulated call with fewer than 4 transcript lines or where your agent never spoke (custom metrics only, not ones that judge the audio). Such calls skip every other metric. Default false.
Replacement set of classification options (CLASSIFICATION output only)
1New maximum number of classifications (CLASSIFICATION output only)
x >= 1Replacement set of scoped tool-definition ids (only for metrics whose tool scoping is editable)
Replacement set of supported contexts. Omit to leave unchanged. Scope and participantRole cannot change after create, so moving to SEGMENT or TURN grading only works on a PER_PARTICIPANT metric (see create).
1CALL, SEGMENT, TURN New formula expression (FORMULA only). Pass sources alongside if the referenced metrics change.
1 - 500Replacement formula sources, required when formula changes the referenced metrics (FORMULA only).
Replacement request (HTTP_REQUEST only). Send the whole request; omitted headers are removed.
Optional free-text audit note recorded on the new version.
Response
The updated metric definition (with versionId advanced to the new version)
The updated metric definition. The variant is selected by calculationType.
- LLM judge metric
- Formula metric
- Pattern metric
- Threshold metric
- HTTP request metric