---
search:
  tags:
    - V1
    - POST
seo:
  description: >-
    Cancel a pending or running test run. Runs that… Reference for the POST
    /v1/projects/{projectId}/test-runs/{testRunId}/cancel endpoint in the
    Judgeval API.
sidebar:
  label: Cancel test run
  badge: POST
title: Cancel test run
type: openapi-operation
---
Cancel a pending or running test run. Runs that already completed, errored, or were canceled cannot be canceled.

`POST /v1/projects/{projectId}/test-runs/{testRunId}/cancel`

**Responses**

- `200` — Response for status 200
- `404` — Response for status 404
- `409` — Response for status 409

Response example, 200:

```json
{
  "test_run": {
    "id": "string",
    "organization_id": "string",
    "project_id": "string",
    "user_id": "string",
    "test_config_id": "string",
    "dataset_id": "string",
    "dataset_version_id": "string",
    "source": "sdk",
    "status": "pending",
    "error_message": "string",
    "started_at": "string",
    "completed_at": "string",
    "created_at": "string",
    "updated_at": "string",
    "name": "string"
  }
}
```
