Idempotent. Canceling an already-canceled or completed run returns 202 with a no-op message rather than an error. Requires runs:write scope.
POST
/runs/{run_id}/cancel
curl \
--request POST 'https://sampleplatform.ccextractor.org/api/v1/runs/{run_id}/cancel' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"reason":"string"}'
Request examples
{
"reason": "string"
}
Response examples (202)
{
"run_id": 42,
"new_run_id": 42,
"action": "cancel",
"status": "accepted",
"message": "string"
}
Response examples (401)
{
"code": "unauthorized",
"message": "Bearer token is missing, expired, or invalid.",
"details": {}
}
Response examples (403)
{
"code": "forbidden",
"message": "Token does not have the required scope for this operation.",
"details": {
"required_scope": "runs:write",
"token_scopes": [
"runs:read",
"results:read"
]
}
}
Response examples (404)
{
"code": "not_found",
"message": "Run 9317 not found.",
"details": {
"resource": "run",
"id": 9317
}
}
Response examples (429)
{
"code": "rate_limited",
"message": "Rate limit exceeded. Retry after 30 seconds.",
"details": {
"retry_after": 30,
"limit": 120,
"window": "60s"
}
}
Response examples (default)
{
"code": "not_found",
"message": "Run 9317 not found.",
"details": {}
}