1. Threads
  2. 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>'

​
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

FieldTypeDescription
thread_idstringThread UUID
run_idstringRun identifier
cancelledbooleanWhether the run was cancelled

​
SDK

result = await client.cancel_run(thread_id, run_id)
print(result["cancelled"])

​
Authorizations

X-API-Key
required
string
API Key authentication

​
Query Parameters

thread_id
required
string
run_id
required
string
authorization
x_session_token

​
Response

application/json
  • 200

  • 422

Successful Response