Delete an Agent API source file in the current workspace.
Endpoint
DELETE /agents/file/{file_id}
Returns 200 and a delete envelope. Repeated deletion returns 404, and writing this source file to an environment fails.
Path parameters
| Field | Required | Type | Description |
|---|---|---|---|
file_id | Yes | string | Source file ID |
404 File not found.
Request example
Response example
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Deleted source file ID |
object | string | Source file deletion result object type, fixed as file.deleted |
deleted | boolean | Whether deletion succeeded, true when deletion succeeds |
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | Use a source file ID that exists in the current workspace |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |