- Threads
- Cancel Run
Threads
Cancel Run
POST
/threads/{thread_id}/runs/{run_id}/cancel
curl --request POST \
--url https://app.backboard.io/api/threads/{thread_id}/runs/{run_id}/cancel \
--header 'X-API-Key: <api-key>' \
--header 'authorization: <authorization>' \
--header 'x_session_token: <x_session_token>'
curl --request POST \
--url https://app.backboard.io/api/threads/{thread_id}/runs/{run_id}/cancel \
--header 'X-API-Key: <api-key>' \
--header 'authorization: <authorization>' \
--header 'x_session_token: <x_session_token>'Overview
Cancel an in-progress run on a thread. Useful when a client stops a streaming response (for example, the user presses stop).
The call is idempotent — cancelling a run that already finished or was cancelled still returns 200.
Response
| Field | Type | Description |
|---|---|---|
thread_id | string | Thread UUID |
run_id | string | Run identifier |
cancelled | boolean | Whether the run was cancelled |
SDK
result = await client.cancel_run(thread_id, run_id)
print(result["cancelled"])
curl --request POST \
--url https://app.backboard.io/api/threads/{thread_id}/runs/{run_id}/cancel \
--header 'X-API-Key: <api-key>' \
--header 'authorization: <authorization>' \
--header 'x_session_token: <x_session_token>'
curl --request POST \
--url https://app.backboard.io/api/threads/{thread_id}/runs/{run_id}/cancel \
--header 'X-API-Key: <api-key>' \
--header 'authorization: <authorization>' \
--header 'x_session_token: <x_session_token>'