---
title: "Create Test Run"
method: POST
path: "/v1/test-runs"
tags: ["Evaluation"]
---

# Create Test Run

`POST /v1/test-runs`

## Request

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

Creates a new in-progress test run and returns its id. Use this id as the `testRunId` when ingesting traces (`POST /v1/traces`) so that each trace becomes one test case in this run.

## Request body

- CreateTestRun
  - `metricCollection` string: This is the metric collection used to evaluate the test cases formed from traces ingested into this test run.
  - `identifier` string: This is an optional human-readable identifier for the test run, shown on the Confident AI platform.

## Response `200`

The created test run id.

- CreateTestRunResponse
  - `success` boolean, required: A boolean indicating the success or failure of the API call
  - `data` object, required: This maps to the test run id.
    - `id` string: This is the unique identifier of the created test run. Pass it as `testRunId` when ingesting traces.
  - `link` string, required: This is the URL to the test run on the Confident AI platform.
  - `deprecated` boolean, required: This is true if this endpoint is deprecated.

## Changes

> 54 revisions in range; 3 not diffed.

- **2026-06-30** `448829180950`: 1 info
  - endpoint added
- **2026-06-29** `77c4156f18d2`: 1 breaking
  - api removed without deprecation
- **2026-06-29** `c77c54067665`: 1 info
  - endpoint added
- **2026-06-28** `0d196a3b614e`: 1 breaking
  - api removed without deprecation
- **2026-06-28** `c1fef814439e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/changes/v1/test-runs/post.md)

---

[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)
