Add Document Attachment
POST
/api/{version}/objects/documents/{doc_id}/attachmentsHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | multipart/form-data |
Accept | application/json (default) or application/xml |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{doc_id} | The document id field value. |
File Upload
Section link for File UploadTo upload the file, use the multi-part attachment with the file component "file={file_name}". The maximum allowed file size is 2GB.
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: multipart/form-data" \
-F "file=my_attachment_file.png" \
https://myvault.veevavault.com/api/v17.1/objects/documents/565/attachmentsResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data":
{
"id": "567",
"version__v": 3
}
}Response Details
Section link for Response DetailsOn 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.