Skip to content

Export Object Record Attachments

Export attachments in bulk from the specified object records. This endpoint starts a job to create a tar.gz export file for later retrieval. A single export can include up to 100,000 attachment files and the size must not exceed 250 GB. Each attachment version counts as a separate file.

When the job has completed, use Retrieve Object Record Attachments Export Results to retrieve the job results and name of the export file.

POST/api/{version}/vobjects/{object_name}/attachments/actions/export
NameDescription
Acceptapplication/json
NameDescription
allVersionsTo export all versions of each attachment, include a query parameter allVersions=true. If allVersions=false, the request exports only the latest version of each attachment. If omitted, defaults to false.
NameDescription
{object_name}The name of the object from which to export attachments.

Include a JSON payload of up to 500 object records.

NameDescription
id
required
The object record id field value.
attachment_ids
optional
An array of attachment id field values to export. Maximum of 100 attachments per record. Omit this parameter to export all attachments on the record.
curl -X POST -H "Authorization: {AUTH_VALUE}" \
https://myvault.veevavault.com/api/v26.3/vobjects/product__v/attachments/actions/export \
--data '[
    {
      "id":"00P000000007001",
      "attachment_ids":[3801,3802,3803]
    },
    {
      "id":"00P00000000K002"
    }
]'
{
    "responseStatus": "SUCCESS",
    "data": {
        "job_id": 1221701,
        "records": [
            {
                "responseStatus": "SUCCESS",
                "data": {
                    "id": "00P000000007001"
                }
            },
            {
                "responseStatus": "WARNING",
                "warnings": [
                    {
                        "warning_type": "INVALID_DATA",
                        "message": "No attachments found for resource [00P00000000K002]"
                    }
                ]
            }
        ]
    }
}

On SUCCESS, the response includes the job ID and job status for each record in the request. If the job runs for more than 23 hours, the job request terminates. Vault skips this job if there are no attachment files on the requested records or if all of the request data is invalid. Partial success is allowed, meaning the export of some object record attachments may succeed while others fail.