POST
Stop the running turn
This endpoint requires an Idempotency-Key request header — omitting it is a 400. See Idempotent requests.
A stop is a request, not a completion. The agent keeps running for about a second while it checkpoints, then ends the run on its own — poll the job to see it reach STOPPED. See Stopping a run.

Authorizations

x-api-key
string
header
required

API key for authentication

Headers

Idempotency-Key
string
required

Required opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true. Omitting it is a 400; reusing a key with a different body is a 422; retrying while the first request is still in flight is a 409.

Path Parameters

session_id
string
required

Session whose run to stop.

Response

Stop request accepted, or reported as unnecessary when no run was live.

session_id
string
required
Example:

"665f1c2e8a1b4c0012ab34cd"

stop_requested
boolean
required

Whether a stop was forwarded to the agent.

False means there was nothing live to stop — the run had already finished. That is a normal answer, not an error: a stop always races the run it is trying to end.

Example:

true

run_status
enum<string> | null

Status of the run at the moment the stop was requested — deliberately unchanged. The run is still going; it reaches STOPPED only once the agent confirms on its own event stream.

Available options:
QUEUED,
RUNNING,
COMPLETED,
FAILED,
STOPPED,
STALE
Example:

"RUNNING"

job_id
string | null

Job handle for the run being stopped. Null when the turn was asked in the app rather than through this API.

Example:

"sajob_9f2c1a4b7e8d4c1fa0b3"

poll_url
string<uri-reference> | null

URL of GET /v2/jobs/{job_id} — poll it until the job reports STOPPED (or the status the run reached on its own).