Skip to main content
POST
/
v1
/
runs
/
{id}
/
cancel
Cancel run by ID
curl --request POST \
  --url https://agent.tinyfish.ai/v1/runs/{id}/cancel \
  --header 'X-API-Key: <api-key>'
{
  "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "CANCELLED",
  "cancelled_at": "2024-01-01T00:00:00Z",
  "message": null
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key from the API Keys page.

Path Parameters

id
string
required

Run ID

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Response

Run cancelled successfully, or already in terminal state (idempotent)

Response from cancel run endpoint

run_id
string
required

The unique identifier of the run

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

status
enum<string>
required

The current status of the run. Returns actual status for idempotent responses (e.g., COMPLETED if run already finished)

Available options:
CANCELLED,
COMPLETED,
FAILED
Example:

"CANCELLED"

cancelled_at
string | null
required

ISO 8601 timestamp when the run was cancelled, or null if not cancelled

Example:

"2026-01-14T10:30:55Z"

message
string | null
required

Additional context about the cancellation result (e.g., "Run already cancelled", "Run already finished")

Example:

"Run already cancelled"