Metric
Create custom metric definition
Changed onCreate a new metric definition. The calculationType field selects the variant: LLM_JUDGE (LLM-evaluated), FORMULA (computed from a math expression over other metrics), or PATTERN (detects a trigger→outcome pattern within a window). To create a threshold on top of an existing metric, use POST /metric/definitions/{idOrSlug}/thresholds instead.
post/v1/metric/definitions
Request
- Base URLhttps://api.roark.ai
- URLhttps://api.roark.ai/v1/metric/definitions
- AuthHTTP bearer
Request body
Example request
{
"name": "Customer Satisfaction",
"slug": "customer_satisfaction",
"metricId": "customer_satisfaction",
"outputType": "BOOLEAN",
"supportedContexts": [
"CALL",
"TURN"
],
"llmPrompt": "Evaluate whether the customer expressed satisfaction with the service provided."
}Response
The created metric definition
Changes
- breaking
added to the
response propertyoneOflist for the response status - info
added
HTTP_REQUESTmapping keys to the request discriminator - info
added to the request body
oneOflist - info
added
HTTP_REQUESTdiscriminator mapping keys to theresponse property for the response status
- breaking
- info
the
/request property's maxLength was increased from3000to20000
- info