---
title: "Create a metric definition"
method: POST
path: "/v1/metric/definitions"
tags: ["Metric"]
---

# Create a metric definition

`POST /v1/metric/definitions`

Create a new custom metric definition. The metric will be added to the specified analysis package and can be used for evaluating calls.

## Request body

- CreateMetricDefinitionInput — Input for creating a new metric definition
  - `name` string, required — Name of the metric
  - `metricId` string — Unique identifier for the metric (e.g. "customer_satisfaction"). Auto-generated from name if not provided.
  - `outputType` 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET', required — Type of value this metric produces
  - `scope` 'GLOBAL' | 'PER_PARTICIPANT' — Whether metric is global or per-participant (default: GLOBAL)
  - `participantRole` 'AGENT' | 'CUSTOMER' | 'SIMULATED_CUSTOMER' | 'BACKGROUND_SPEAKER' — Participant role to evaluate. Required when scope is PER_PARTICIPANT.
  - `supportedContexts` string[] — Which levels this metric can produce values at (default: ["CALL"])
  - `llmPrompt` string — LLM prompt/criteria for evaluating this metric. Used to instruct the model on how to score. Required for BOOLEAN, NUMERIC, TEXT, and SCALE types.
  - `analysisPackageId` string, uuid, required — ID of the analysis package to add this metric to
  - `booleanTrueLabel` string — Label for the true/positive case (only for BOOLEAN type)
  - `booleanFalseLabel` string — Label for the false/negative case (only for BOOLEAN type)
  - `scaleMin` integer — Minimum value for scale. Required for SCALE type.
  - `scaleMax` integer — Maximum value for scale. Required for SCALE type.
  - `scaleLabels` object[] — Labels for scale ranges (only for SCALE type)
    - `rangeMin` number, required — Minimum value for this label range
    - `rangeMax` number, required — Maximum value for this label range
    - `label` string, required — Label for this range
    - `description` string — Description of what this range means
    - `displayOrder` integer, required — Display order of this label
    - `colorHex` string — Hex color code for this label (e.g. "#FF0000")
  - `classificationOptions` object[] — Options for classification. Required for CLASSIFICATION type.
    - `label` string, required — Label for this classification option
    - `description` string, required — Description of what this option means
    - `displayOrder` integer, required — Display order of this option
  - `maxClassifications` integer — Maximum number of classifications that can be selected (only for CLASSIFICATION type)

## Response `201`

The created metric definition

- object
  - `data` MetricDefinitionResponse, required — Metric definition data
    - `id` string, uuid, required — Unique identifier for the metric definition
    - `metricId` string, required — Stable metric identifier (e.g. "call_reason", "customer_satisfaction")
    - `name` string, required — Name of the metric
    - `description` string, required — Description of what the metric measures
    - `type` 'COUNT' | 'NUMERIC' | 'BOOLEAN' | 'SCALE' | 'TEXT' | 'CLASSIFICATION' | 'OFFSET', required — Type of value this metric produces
    - `scope` 'GLOBAL' | 'PER_PARTICIPANT', required — Whether metric is global or per-participant
    - `supportedContexts` string[], required — Which levels this metric can produce values at
    - `unit` object — Unit information if applicable
      - `name` string, required — Name of the unit
      - `symbol` string, nullable, required — Symbol for the unit

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/roarkhq/apis/roark-analytics-api.md) · [All operations](https://skmtc.net/roarkhq/apis/roark-analytics-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/roarkhq/roark-analytics-api/revisions/83528d3618ef/schema)
