Skip to content

Create an attachment on the latest version of a document. If the attachment already exists, Vault uploads the attachment as a new version of the existing attachment. Learn more about attachment versioning in Vault Help.

To create a version-specific attachment, or to create multiple attachments at once, use the bulk API.

POST/api/{version}/objects/documents/{doc_id}/attachments
NameDescription
Content-Typemultipart/form-data
Acceptapplication/json (default) or application/xml
NameDescription
{doc_id}The document id field value.

To upload the file, use the multi-part attachment with the file component "file={file_name}". The maximum allowed file size is 2GB.

curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: multipart/form-data" \ -F "file=my_attachment_file.png" \ https://myvault.veevavault.com/api/v19.2/objects/documents/565/attachments
{ "responseStatus": "SUCCESS", "data": { "id": "567", "version__v": 3 } }

On SUCCESS, the response will contain the attachment ID and version of the newly added attachment. Document attachments are automatically bound to all versions of a document. The following attribute values are determined based on the file in the request: filename__v, format__v, size__v.