Update a metric definition
Changed onUpdate 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/{idOrSlug}/variants/{variantId}, which forks it for you and leaves every other workspace on the original.
Request
- Base URLhttps://api.roark.ai
- URLhttps://api.roark.ai/v1/metric/definitions/{idOrSlug}
- AuthHTTP bearer
Path parameters
The metric definition's Roark ID (UUID) or its stable slug (e.g. customer_satisfaction).
Request body
Example request
{
"httpRequest": {
"url": "https://api.example.com/roark/checks/pin-changed",
"headers": {
"Authorization": "Bearer sk_live_..."
}
}
}Response
The updated metric definition (with versionId advanced to the new version)
Changes
- breaking
added to the
response propertyoneOflist for the response status - info
added the new optional request property
- info
added
HTTP_REQUESTdiscriminator mapping keys to theresponse property for the response status
- breaking
- info
the
request property's maxLength was increased from3000to20000
- info