Delete Attachment API
This document explains how to use the Attachments API to delete attachments. Before proceeding, ensure you have a foundational understanding of document definitions and documents.
For v1 API call, check this delete documentation.
Core Resource Path
The core path structure for all attachment operations, including deletion, is:
api/v2/document-definitions/[DDname or DDid]/documents/[documentId or externalId]/attachments
Parameters
These parameters must be updated to correspond to the correct document definition and document:
Parameter | Description |
---|---|
DDname or DDid | Replace with the name or ID of the Document Definition. |
documentId or externalId | Replace with the ID or the external ID of the specific Document. |
Endpoints
The following endpoint is available for deleting attachments:
URL | HTTP Method | Description |
---|---|---|
/attachments?valuePath={valuePath}&attachmentId={attachmentId} |
DELETE | Deletes a specific attachment identified by its attachmentId at a given valuePath within a document. |
Using the API Script
You can use the internal REST.call()
script to make API calls.
Return Values
Default return values is the status of succes or not.
Example: Delete an Attachment (cURL)
This example shows how to delete a specific attachment using its attachmentId and valuePath. Remember to fill in your API domain, IDs, and access token.
curl -X DELETE "[Main API Domain]/api/v2/document-definitions/YOUR_DD_ID/documents/YOUR_DOCUMENT_ID/attachments?valuePath=YOUR_VALUE_PATH&attachmentId=ATTACHMENT_TO_DELETE_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/json" \
-H "environment-id": ID
{"status":"ok"}