Create custom metric definition
Create 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.
Request body
Example request
{
"name": "Customer Satisfaction",
"slug": "customer_satisfaction",
"metricId": "customer_satisfaction",
"outputType": "BOOLEAN",
"llmPrompt": "Evaluate whether the customer expressed satisfaction with the service provided."
}Response
The created metric definition
Changes
Changed in 2 of the 105 revisions of this API.10266
- ○
the request property
oneOf[subschema #1: LLM judge metric]/analysisPackageIdbecame optionalrequest-property-became-optional
- ○
the request property
oneOf[subschema #2: Formula metric]/analysisPackageIdbecame optionalrequest-property-became-optional
- ○
the request property
oneOf[subschema #3: Pattern metric]/analysisPackageIdbecame optionalrequest-property-became-optional
- ○
- ▲
the request's body type/format changed from
object/to/request-body-type-changed
- ▲
added
LlmJudgeMetricResponseFormulaMetricResponsePatternMetricResponseto thedataresponse propertyoneOflist for the response status201response-property-one-of-added
- ▲
the
dataresponse's property type/format changed fromobject/to/for status201response-property-type-changed
- ▲
removed the required property
data/descriptionfrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
data/idfrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
data/metricIdfrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
data/namefrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
data/scopefrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
data/supportedContextsfrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
data/typefrom the response with the201statusresponse-required-property-removed
- ●
removed the request property
analysisPackageIdrequest-property-removed
- ●
removed the request property
booleanFalseLabelrequest-property-removed
- ●
removed the request property
booleanTrueLabelrequest-property-removed
- ●
removed the request property
classificationOptionsrequest-property-removed
- ●
removed the request property
llmPromptrequest-property-removed
- ●
removed the request property
maxClassificationsrequest-property-removed
- ●
removed the request property
metricIdrequest-property-removed
- ●
removed the request property
namerequest-property-removed
- ●
removed the request property
outputTyperequest-property-removed
- ●
removed the request property
participantRolerequest-property-removed
- ●
removed the request property
scaleLabelsrequest-property-removed
- ●
removed the request property
scaleMaxrequest-property-removed
- ●
removed the request property
scaleMinrequest-property-removed
- ●
removed the request property
scoperequest-property-removed
- ●
removed the request property
supportedContextsrequest-property-removed
- ●
removed the optional property
data/unitfrom the response with the201statusresponse-optional-property-removed
- ●
added the new
conflictenum value to thetyperesponse property for the response status400response-property-enum-value-added
- ●
added the new
conflictenum value to thetyperesponse property for the response status401response-property-enum-value-added
- ●
added the new
conflictenum value to thetyperesponse property for the response status403response-property-enum-value-added
- ●
added the new
conflictenum value to thetyperesponse property for the response status429response-property-enum-value-added
- ●
added the new
conflictenum value to thetyperesponse property for the response status500response-property-enum-value-added
- ●
added the new
payment_requiredenum value to thetyperesponse property for the response status400response-property-enum-value-added
- ●
added the new
payment_requiredenum value to thetyperesponse property for the response status401response-property-enum-value-added
- ●
added the new
payment_requiredenum value to thetyperesponse property for the response status403response-property-enum-value-added
- ●
added the new
payment_requiredenum value to thetyperesponse property for the response status429response-property-enum-value-added
- ●
added the new
payment_requiredenum value to thetyperesponse property for the response status500response-property-enum-value-added
- ○
added request discriminator
request-body-discriminator-added
- ○
added
PromptMetricInputFormulaMetricInputPatternMetricInputto the request bodyoneOflistrequest-body-one-of-added
- ○
added discriminator to
dataresponse property for the response status201response-property-discriminator-added
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲