---
title: "Create Collection"
method: POST
path: "/v1/metric-collections"
tags: ["Metric Collections"]
---

# Create Collection

`POST /v1/metric-collections`

## Request

- Base URL: `https://api.confident-ai.com`
- URL: `https://api.confident-ai.com/v1/metric-collections`
- Auth: none declared
- TypeScript: <https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/docs/v1/metric-collections/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a metric collection with the `name` and the `metricSettings` you specified.

## Request body

- CreateMetricCollection: Request schema to create or update a metric collection
  - `name` string, required: This is the unique name of the metric collection you wish to create.
  - `multiTurn` boolean: This is true if your metric collection is multi-turn, which contains only multi-turn metrics. Defaulted to `false`.
  - `metricSettings` MetricSetting[]: This is the list of metric settings for the collection.
    - `metric` object: This is a metric object, which contains the metric name.
      - `name` string, required: This is the name of the metric.
    - `activated` boolean: This determines if the metric is activated. Only activated metrics are used for evaluations. Non-activated metrics are skipped.
    - `threshold` number: This determines the threshold for the metric which determines if the metric passes or fails depending on if the metric score is equal or greater than the threshold.
    - `includeReason` boolean: This determines if the reason for the metric score should be generated during evaluations.
    - `strictMode` boolean: This determines if the metric is in strict mode. Metrics in strict mode output a binary score of 0 or 1, indicating pass or fail, as opposed to a continuous score from 0 to 1.
    - `sampleRate` number: This determines the probability of the metric being ran for evaluation.

## Response `200`

- CreateMetricCollectionResponse
  - `success` boolean, required: This is true if the metric collection was created successfully.
  - `data` object, required: This maps to the id of the metric collection.
    - `id` string, required: This is the id of the metric collection.
  - `deprecated` boolean, required: This is true if this metric collection endpoint is deprecated.

---

[API](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api.md) - [All operations](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/revisions/95cdde71b65e?raw)
