Skip to main content

Delete Session Resource

Unmounts a resource from a session and clears its internal copy. This operation cannot be undone.

Prerequisites

Endpoint and authentication configured. For details, see Overview and authentication.

Endpoint

DELETE /sessions/{session_id}/resources/{resource_id}

Path parameters

FieldRequiredTypeDescription
session_idYesstringSession ID, format sesn_<ULID>
resource_idYesstringResource ID, format sesrsc_<ULID>

Request example

curl -X DELETE "$AGENTSTUDIO_URL/sessions/sesn_xxx/resources/sesrsc_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

{
  "id": "sesrsc_xxx",
  "type": "session_resource_deleted",
  "request_id": "xxx"
}

Response fields

FieldTypeDescription
idstringID of the unmounted resource
typestringAlways session_resource_deleted, indicating successful unmount
request_idstringUnique request identifier

Error codes

HTTP statusError codeDescription
400InvalidParameterRequired parameter missing or invalid
401InvalidApiKeyInvalid API key provided
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration