Delete File

更新时间:
复制 MD 格式

Hard deletes the file metadata and original content; this action cannot be undone. Internal copies already mounted to session sandboxes are not affected; new sessions can no longer mount this file_id.

Prerequisites

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

Endpoint

DELETE /files/{file_id}

Request example

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

Response example

{
  "id": "file_xxx",
  "type": "file_deleted",
  "request_id": "xxx"
}

Response fields

Field

Type

Description

id

string

ID of the deleted file

type

string

Fixed value file_deleted, indicating successful deletion

request_id

string

Unique identifier for this request