Delete Attachment¶
POST /api/v1/attachment/delete
Overview¶
Marks an attachment in the current workspace as deleted. After deletion, the file can no longer be obtained through the attachment download API using this identifier.
Prerequisites and Usage Steps¶
- Take the value from content.attachmentUuid in the successful response of Attachment Upload.
- Use a workspace API Key that has attachment management permissions. Once you confirm the attachment is no longer needed, send the JSON as shown in the example.
- If the attachment is already deleted or no matching record exists in the current workspace, true is also returned. Sending the same identifier repeatedly does not create a new record.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | AK identifier, AK uuid Example: <DF-API-KEY>How to obtain or enter: Retrieve a Key with permissions for this API from API Key Management in the target workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| attachmentUUID | string | Y | Attachment UUID Allows null: False Example: att_00000000000000000000000000000000How to obtain or enter: Take the value from content.attachmentUuid in the successful response of Attachment Upload. |
Request Example¶
curl 'https://openapi.guance.com/api/v1/attachment/delete' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"attachmentUUID":"att_00000000000000000000000000000000"}'
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content | boolean | true when processing is complete, including when the current workspace has no matching record. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | The JSON object is missing the required attachment identifier or the type does not match | The message indicates attachmentUUID or its validation rule. | Check the field name casing and pass a string. |
| 400 | ft.RequestJsonFormatError | Request JSON syntax error | Request JSON format error. Returns reason, line, and column. | Fix the JSON based on the position. |