Skip to main content
POST
/
api
/
test-runs
/
{id}
/
cancel
Cancel Test Run
curl --request POST \
  --url https://api.example.com/api/test-runs/{id}/cancel \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reason": "<string>"
}
'
{
  "message": "Test run cancelled successfully"
}
Cancels a test run that is currently in progress or pending. The test run will transition to the cancelling state and then to cancelled once the operation completes.

Examples

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
id
number
required
The unique identifier of the test run to cancel.
reason
string
Optional reason for cancelling the test run. This will be recorded for auditing purposes.

Response

message
string
Confirmation message indicating the test run was cancelled.
{
  "message": "Test run cancelled successfully"
}

Basic cancel

curl -X POST \
  "https://dash.empirical.run/api/test-runs/456/cancel" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"

Cancel with reason

curl -X POST \
  "https://dash.empirical.run/api/test-runs/456/cancel" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "reason": "Deployment rolled back"
  }'