API Reference
Cancel team run
DELETE /api/v1/teams/:teamId/runs/:runId — cancel an in-progress synchronous or streaming team run.
Cancels a team run that is still in progress, by the runId a /run-sync response or a /run-stream RunStarted event carried. Use it from another request — for example when your user abandons a long answer. Closing a stream's connection cancels its run on its own, so a stream needs no separate call.
For a run started with /run-async, cancel the job instead: Cancel team job.
DELETE /api/v1/teams/{teamId}/runs/{runId}Path parameters
| Parameter | Type | Description |
|---|---|---|
teamId | string (UUID) | The team the run belongs to. |
runId | string | The run to cancel. |
Response
200 OK whether or not the run was still going:
{ "cancelled": true, "runId": "b7e1..." }{ "cancelled": false, "runId": "b7e1...", "message": "Run already completed." }Cancelling a run that has already finished is not an error.
Errors
| Status | error | When |
|---|---|---|
403 | forbidden | The team belongs to a different project than your project-scoped key. |
404 | team_not_found | No team with that ID exists in your organization. |
404 | run_not_found | No run with that ID is known to the team runtime. |
502 | bad_gateway | The team runtime is unreachable. |
Example
curl -X DELETE https://api.elizon.ai/api/v1/teams/{teamId}/runs/{runId} \
-H "X-API-Key: elz_your_key_here"