Skip to main content

Endpoint

Ends a session and cleans up what it scoped: records written with retention=session under this session_id are hard-deleted (rows physically removed), and any chat history threaded on it is removed from the API surface. deleted counts what was purged.
Pass the same user you used when writing the session’s data; omitting it targets your account’s default Subject.
Response:

How sessions work

A session_id is a cleanup scope with a name — one id that ties together the working data and conversation of one interaction:
  1. Scopes retention=session data — records written via POST /v1/data (or POST /v1/extract with store=true) with retention: "session" must carry a session_id, and live only until the session is deleted (capped at 24h regardless).
  2. Binds durable conversations on the Agent API — passing session_id to POST /v1/responses makes the conversation durable and resumable under that id. See State & memory.
See retention for the full lifetime model.