Delete Multiple Sessions

Select sessions and storage

Use the registered session database; db_id is required when multiple database IDs are available, and table requires db_id. Authentication and user isolation determine the effective user scope; non-admin service-account PAT callers self-scope.

Send equal-length, nonempty session_ids and session_types arrays. The local adapters delete by session ID and effective user; session_types does not act as a type guard. Use IDs from the intended sessions rather than relying on a supplied type to prevent deletion.

delete_media=false retains offloaded media. With true, AgentOS must have media storage configured (503 otherwise); RemoteDb media deletion is unsupported (501). Media cleanup is best-effort after database rows are deleted, so failure does not imply session deletion was rolled back.

DELETE/sessions

Delete multiple sessions by their IDs in a single operation. This action cannot be undone and will permanently remove all specified sessions and their runs.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

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 sessions' offloaded media from media storage

Defaultfalse

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl --request DELETE 'https://example.com/sessions' \  --header 'Content-Type: application/json' \  --data-raw '{"session_ids":["string"],"session_types":["agent"]}'
Empty