Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview

Cancel test run

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
Authorization
AuthorizationPersonal API key · headerrequired

Your personal API key from Settings > Personal API Keys, sent as Bearer <key>.

X-Organization-IdOrganization ID · headerrequired

The organization to act in. Copy it with Copy organization ID in the organization menu or the settings sidebar.

Path parameters
projectIdstringrequired
testRunIdstringrequired
Responses
200

Response for status 200

test_runobjectrequired
Show properties
idstringrequired
organization_idstringrequired
project_idstringrequired
user_idstringrequired
test_config_idstringrequired
dataset_idstringrequired
dataset_version_idstringrequired
sourcestringrequired
Allowed:sdkclimcpplatformlegacy
statusstringrequired
Allowed:pendingrunningcompletederrorcancelled
error_messagestring | nullrequired
started_atstring | nullrequired
completed_atstring | nullrequired
created_atstringrequired
updated_atstringrequired
namestringrequired
404

Response for status 404

errorstringrequired
messagestring
codestring
detailsstring[]
409

Response for status 409

errorstringrequired
messagestring
codestring
detailsstring[]
Try it
Server
Authorization
Parameters
Request
curl -X POST 'https://api.judgmentlabs.ai/v1/projects/YOUR_PROJECT_ID/test-runs/YOUR_TEST_RUN_ID/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Organization-Id: YOUR_ORGANIZATION_ID' \
  -H 'Accept: application/json'
Response
{
  "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"
  }
}

Was this page helpful?