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}

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"
}

Response fields

Field

Type

Description

id

string

The deleted session ID

type

string

Fixed as session_deleted, indicating successful deletion

request_id

string

Unique identifier for this request