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.

DELETE/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
AuthorizationBearer <token>

In: header

Path Parameters

session_id*Session Id

Session ID to delete

Query Parameters

user_id?|

User ID to scope deletion to

db_id?|

Database ID to use for deletion

table?|

Table to use for deletion

delete_media?Delete Media

Also delete the session's offloaded media from media storage

Defaultfalse

Response Body

application/json

application/json

application/json

application/json

application/json

curl --request DELETE 'https://example.com/sessions/string'
Empty