---
title: "Create Custom Metric"
method: POST
path: "/api/v1/custom-metrics"
tags: ["custom-metrics"]
---

# Create Custom Metric

`POST /api/v1/custom-metrics`

Create a new custom metric with revision 1.

## Request body

- CustomMetricCreate — Request body for POST /custom-metrics.
  - `name` string, required
  - `description` string, nullable
  - `category` string, nullable
  - `compute_type` 'model' | 'formula', required
  - `response_type` 'pass_fail' | 'yes_no' | 'numeric_score' | 'categorical' | 'text' | 'json', required
  - `tags` string[]
  - `linked_agent_ids` string[]
  - `applies_to_voice` boolean
  - `applies_to_text` boolean
  - `applies_to_email` boolean
  - `applies_to_booking` boolean
  - `prompt` string, nullable
  - `model` string, nullable
  - `config` object
  - `allow_na` boolean
  - `proof` string, nullable

## Response `201`

Successful Response

- CustomMetricWithRevisionResponse — Response for create/edit: the metric + its active revision.
  - `metric` CustomMetricRead, required
    - `id` string, uuid, required
    - `name` string, required
    - `description` string, nullable, required
    - `category` string, nullable, required
    - `source_template_key` string, nullable, required
    - `compute_type` 'model' | 'formula', required
    - `response_type` 'pass_fail' | 'yes_no' | 'numeric_score' | 'categorical' | 'text' | 'json', required
    - `status` 'active' | 'archived', required
    - `tags` string[], required
    - `active_revision_id` string, uuid, nullable, required
    - `linked_agent_ids` string[], required
    - `applies_to_voice` boolean, required
    - `applies_to_text` boolean, required
    - `applies_to_email` boolean, required
    - `applies_to_booking` boolean, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `is_booking_intent_definition` boolean, required — True when this metric is the tenant's Booking Intent classifier. Derived from the tag so the frontend never hardcodes the magic string. Set/cleared only via the dedicated designation endpoint.
  - `revision` CustomMetricRevisionRead, required
    - `id` string, uuid, required
    - `custom_metric_id` string, uuid, required
    - `revision_number` integer, required
    - `prompt` string, nullable, required
    - `model` string, nullable, required
    - `config` object, required
    - `allow_na` boolean, required
    - `created_by_user_id` string, uuid, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `401` — Authentication required
- `422` — Formula expression has not been previewed

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getanana/cleon-api/revisions/3ad158624c53/schema)
