Skip to main content
POST
Cancel a single run

Authorizations

Authorization
string
header
required

Send Authorization: Bearer tst_live_….

Format (services/api-keys.ts): the literal prefix tst_live_ followed by 24 random bytes rendered as 32 base64url characters. Only the SHA-256 hash is stored server-side. The shape check that routes a token down the API-key path rather than the Clerk JWT path requires the tst_live_ prefix and a total length of at least 25 characters.

Keys are minted in the dashboard at /settings/team. The same header also accepts a Clerk session JWT, which is how the web app authenticates, but the JWT path is out of scope for this document.

Path Parameters

id
string<uuid>
required

Run id (UUID). Returned as runId by POST /api/runs/trigger. Not UUID-validated by the handler; a malformed value simply finds nothing and 404s.

Response

Cancellation processed. cancelled counts DB rows flipped to cancelled (0 or 1 here); reapedHandlers counts live orchestrators actually torn down, which is lower when the process already exited.

cancelled
integer
required

Number of DB rows flipped from pending/running to cancelled. Zero when the run(s) had already finished.

Required range: x >= 0
reapedHandlers
integer
required

Number of live orchestrators whose in-memory cancel handler actually fired and tore a browser down. Can be lower than cancelled when a process already exited.

Required range: x >= 0