DELETE
Delete an agent session
A live run is stopped rather than the delete being refused. The session’s turns are retained but become unreachable, and a stopped run’s job stays pollable at GET /v2/jobs/{job_id}. See Deleting a session.
This endpoint accepts an optional Idempotency-Key request header so a retry cannot apply the change twice. See Idempotent requests.

Authorizations

x-api-key
string
header
required

API key for authentication

Headers

Idempotency-Key
string

Optional 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.

Path Parameters

session_id
string
required

The session to delete.

Response

The session was deleted.

session_id
string
required
Example:

"665f1c2e8a1b4c0012ab34cd"

deleted
enum<boolean>
required
Available options:
true
Example:

true

stopped_run
boolean
required

Whether a live run was stopped as part of the delete.

False when the session had nothing running. True means the agent was asked to stop and will end the run shortly — the job stays pollable, so the partial answer and the real cost are still readable afterwards.

Example:

false

job_id
string | null

Job handle of the run that was stopped, still pollable after the session is gone. Null when nothing was running, or when the turn was asked in the app.

Example:

"sajob_9f2c1a4b7e8d4c1fa0b3"