Skip to main content
POST
/
v1
/
runs
/
batch
/
cancel
Cancel multiple runs by IDs
curl --request POST \
  --url https://agent.tinyfish.ai/v1/runs/batch/cancel \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "run_ids": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "b2c3d4e5-f6a7-8901-bcde-f23456789012"
  ]
}
'
{
  "results": [
    {
      "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "status": "CANCELLED",
      "cancelled_at": "2024-01-01T00:00:30Z",
      "message": null
    },
    {
      "run_id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "status": "COMPLETED",
      "cancelled_at": null,
      "message": "Run already finished"
    }
  ],
  "not_found": [
    "b2c3d4e5-f6a7-8901-bcde-f23456789012"
  ]
}

Authorizations

X-API-Key
string
header
required

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

Body

application/json

Array of run IDs to cancel

Batch runs request

run_ids
string[]
required

Array of run IDs (1-100)

Required array length: 1 - 100 elements
Example:
[
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6a7-8901-bcde-f23456789012"
]

Response

Request succeeded. Returns per-run results in results and any missing IDs in not_found.

Batch cancel runs response

results
object[]
required

Results for runs that were found and processed (cancelled or already terminal)

not_found
string[] | null
required

Run IDs that were not found or not owned. Null if all found.