---
title: "Cancel a Test run"
method: DELETE
path: "/api/v2/projects/{projectId}/tests/{testId}/runs/{runId}"
tags: ["Tests"]
---

# Cancel a Test run

`DELETE /api/v2/projects/{projectId}/tests/{testId}/runs/{runId}`

## Request

- Base URL: `https://davinci-app.com`
- URL: `https://davinci-app.com/api/v2/projects/{projectId}/tests/{testId}/runs/{runId}`
- Auth: HTTP bearer

Requests cancellation and evaluation-sandbox cleanup. The operation is
idempotent. A run already completed remains completed; a run that can be
interrupted moves through `cancelling` to `cancelled`.

## Response `200`

Terminal state after cancellation or an already-terminal run.

- TestRun
  - `runId` string, uuid, required
  - `projectId` string, required
  - `branchName` string, required
  - `testId` string, required
  - `codeObjectId` string
  - `evaluationRunId` string, uuid
  - `status` 'queued' | 'starting' | 'running' | 'evaluating' | 'cancelling' | 'completed' | 'failed' | 'cancelled' | 'timed_out', required: `completed`, `failed`, `cancelled`, and `timed_out` are terminal. `failed` means the Code execution or evaluation infrastructure failed; a valid low observation still completes and may resolve to a failing Test verdict.
  - `observation` number: Finite numeric observation committed to the Test's Results Value.
  - `unit` string
  - `verdict` TestRunVerdict
    - `name` string, required
    - `score` number, nullable
    - `criteriaTarget` string
  - `evidence` object: Fixture-defined structured evidence. SYSTEM quality fixtures include transcript, final-tree, usage, and rubric summaries; callers must tolerate additional fixture-specific fields.
  - `failure` RunFailure
    - `code` 'EVALUATION_SCOPE_MISSING' | 'EVALUATION_AGENT_FAILED' | 'EVALUATION_TIMEOUT' | 'EVALUATION_EVIDENCE_MISSING' | 'EVALUATION_OBSERVATION_INVALID' | 'EVALUATION_CLEANUP_FAILED' | 'CODE_EXECUTION_FAILED' | 'TEST_CANCELLED' | 'TEST_RUN_FAILED' | 'TEST_RUN_TIMED_OUT', required
    - `message` string, required
    - `infrastructure` boolean, required: True when no quality verdict may be inferred from this failure.
    - `details` object
  - `createdAt` string, date-time, required
  - `startedAt` string, date-time
  - `completedAt` string, date-time
  - `updatedAt` string, date-time

## Other responses

- `202`: Cancellation has been accepted and is in progress.
- `401`: No credential was supplied, or the supplied credential is malformed, expired, or revoked. A credential that is present but unusable is never downgraded to an anonymous request.
- `403`: API key lacks a required scope. Error code is `INSUFFICIENT_SCOPES`.
- `404`: The resource does not exist in the parent named by the path, or is hidden from the caller. Absence and privacy denial are deliberately indistinguishable so project, organization, and private-team existence cannot be probed.
- `429`: Request rate exceeded, either globally or for this key.
- `500`: Unexpected server error.

## Changes

- **2026-09-15** (v2) `67c8b8616dbb`: 5 info
  - the `success` response property const value `false` was added for the status `401`
  - the `success` response property const value `false` was added for the status `403`
  - the `success` response property const value `false` was added for the status `404`
  - the `success` response property const value `false` was added for the status `429`
  - …1 more
- **2026-09-15** (v2) `48948af37797`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/changes/api/v2/projects/:projectId/tests/:testId/runs/:runId/delete.md)

---

[API](https://skmtc.dev/celedon-solutions/apis/davinci-public-api.md) - [All operations](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/revisions/279218ca2e8d?raw)
