Skip to main content
Data flows in through structured records and files. Structured readings are standardized; uploaded files retain their original and extracted text. Both can ground the agent’s answers. This page closes the loop: how data leaves — on your terms. Three exits, from automatic to total:
  1. Retention expiry — time-bounded writes (1h / 2h / 6h / 1d) expire on their own; see Data retention.
  2. Session deletion — one call tears down a named working scope (below).
  3. Subject offboarding — one call erases everything about a Subject (below).

Sessions

A session_id can identify both a working-data scope and an Agent conversation:
  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 until the session is deleted — deleting the session is what clears them, so don’t skip it.
  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.
Ends the working-data scope: records written with retention=session under this session_id are erased (together with their FHIR mirrors), session-tier file uploads are removed, and the underlying chat session is marked closed.
This endpoint does not delete stored Responses API objects. A response created with the same session_id remains available through GET /v1/responses/{id} and can still be chained. Delete the response objects with DELETE /v1/responses/{id}, or use Subject offboarding to erase every stored response for that Subject.
Pass the same user you used when writing the session’s data; omitting it targets your account’s default Subject.
deleted counts session-scoped records, session-scoped files, and the underlying chat-session row. It does not count stored Responses API objects. 0 means none of those resources matched.

Offboarding a Subject

Right to be forgotten in a single call. It erases everything about one Subject:
  1. Structured records — everything written via POST /v1/data or stored extractions, regardless of retention — including their FHIR resources.
  2. Files — everything uploaded via POST /v1/files, immediately gone from the API.
  3. Stored Agent API conversations — immediately unreadable (GET /v1/responses/{id} returns 404) and purged by a background job.
  4. The identity mapping — the Subject itself becomes unreachable. A later request that passes the same user mints a fresh, empty Subject with no connection to the erased one.
An erase never creates the very Subject it is erasing: resolution looks up the existing mapping only. Passing a user your account has never used returns 404 — nothing is minted.
For finer-grained deletion, use the per-piece levers instead: DELETE /v1/data (records), DELETE /v1/files/{key} (one file), DELETE /v1/responses/{id} (one stored response), DELETE /v1/sessions/{id} (session-scoped data and files). See Compliance for the full user-rights picture.

Errors