Delete Session
Storage and ownership
Start the example API server and create a run or precreate a session. Keep the returned session_id. Use db_id when multiple registered databases exist; selecting table requires db_id and a configured adapter. It does not create a table on demand.
The session-type query parameter is type=agent, type=team or type=workflow. JWT user isolation is opt-in; non-admin service-account PAT callers always self-scope. A supplied user_id is a filter for unscoped callers, not permission to access another owner's records. Configured authorization also requires the relevant session read, write or delete scope.
Deletion scope
Deleting removes the selected session and its run records. Memories and traces are separate resources. A 204 can also acknowledge a missing session; it does not prove that a row existed.
delete_media defaults to false. Opting in requires configured AgentOS media storage (503 otherwise); remote media deletion returns 501. Media cleanup is best-effort after database deletion, not one atomic operation with the session.
/sessions/{session_id}Permanently delete a specific session and all its associated runs. This action cannot be undone and will remove all conversation history.
Authorization
HTTPBearer In: header
Path Parameters
Session ID to delete
Query Parameters
User ID to scope deletion to
Database ID to use for deletion
Table to use for deletion
Also delete the session's offloaded media from media storage
falseResponse Body
application/json
application/json
application/json
application/json
application/json
curl --request DELETE 'https://example.com/sessions/string'{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}