Delete Session

Updated at:

Hard delete: permanently removes session metadata, event history, and internally copied resources. This action is irreversible. To preserve event history, use the archive endpoint instead.

Prerequisites

Endpoint and authentication configuration must be completed. For details, see Overview and authentication.

Endpoint

DELETE/sessions/{session_id}

Path parameters

session_idstringRequired

Session ID, format sesn_<ULID>

Response fields

idstring

The deleted session ID

typestring

Fixed as session_deleted, indicating successful deletion

request_idstring

Unique identifier for this request

Request example

curl -X DELETE "$AGENTSTUDIO_URL/sessions/sesn_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
client.sessions.delete("sesn_xxx")
client.sessions().delete("sesn_xxx");

Response example

{
  "id": "sesn_xxx",
  "type": "session_deleted",
  "request_id": "xxx"
}