Skip to content

Delete Attachment



POST /api/v1/attachment/delete

Overview

Marks the attachment in the current workspace as deleted. After deletion, the identifier can no longer be used to retrieve the file through the attachment download API.

Prerequisites and Steps

  1. Get the value from content.attachmentUuid in the successful response of Upload Attachment.
  2. Use a workspace API Key with attachment management permissions. After confirming that the attachment is no longer needed, send the JSON as shown in the example.
  3. If the attachment has already been 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 Type Required Description
DF-API-KEY string Y AK identifier, AK UUID
Example: <DF-API-KEY>
How to obtain or enter: Obtain a Key with permissions for this API from API Key Management in the target workspace.

Body Request Parameters

Parameter Type Required Description
attachmentUUID string Y Attachment UUID
Allows null: False
Example: att_00000000000000000000000000000000
How to obtain or enter: Get the value from content.attachmentUuid in the successful response of Upload Attachment.

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 no matching record exists in the current workspace.
{
    "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 Resolution
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 Invalid JSON syntax in the request Invalid request JSON format. Returns reason, line, column. Fix the JSON based on the position.

Feedback

Is this page helpful?