Delete Multiple Document Attachments
Delete multiple document attachments in bulk with a JSON or CSV input file. This works for version-specific attachments and attachments at the document level.
- The maximum input file size is 1GB.
- The values in the input must be UTF-8 encoded.
- CSVs must follow the standard RFC 4180 format, with some exceptions.
- The maximum batch size is 500.
DELETE
/api/{version}/objects/documents/attachments/batchHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/json or text/csv |
Accept | application/json (default) or text/csv or application/xml |
Body Parameters
Section link for Body ParametersPrepare a CSV or JSON input file.
| Name | Description |
|---|---|
id | The attachment ID to delete. |
document_id__v | Optional: The source document id value. |
external_id__v | Optional: Identify attachments by their external_id rather than attachment_id. If both attachment_id and external_id__v are provided, Vault ignores external_id. |
Request
Section link for Requestcurl -X DELETE -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \
--data-binary @"C:\Vault\Documents\delete_attachments.csv" \
https://myvault.veevavault.com/api/v20.1/objects/documents/attachments/batchResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data": [
{
"responseStatus": "SUCCESS",
"id": 26
}
]
}Response Details
Section link for Response DetailsOn SUCCESS, the response returns the id of all successfully deleted attachments. You can only delete the latest version of an attachment.