**Source URL:** https://limited.veevavault.dev/safety/vault-api/api-reference/26.3/vault-objects/object-record-attachments/export-object-record-attachments

# 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](/safety/vault-api/api-reference/26.3/vault-objects/object-record-attachments/retrieve-object-record-attachments-export-results) to retrieve the job results and name of the export file.

<Endpoint path="/api/{version}/vobjects/{object_name}/attachments/actions/export" method="POST" />

## Headers

| Name | Description |
| --- | --- |
| `Accept` | `application/json` |

## Query Parameters

<FieldTable>
| Name | Description |
| --- | --- |
| `allVersions` | To 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`. |
</FieldTable>

## URI Path Parameters

<FieldTable>
| Name | Description |
| --- | --- |
| `{object_name}` | The name of the object from which to export attachments. |
</FieldTable>

## Body Parameters

Include a JSON payload of up to 500 object records.

<FieldTable>
| Name | Description |
| --- | --- |
| `id`<Requiredness type="required" /> | The object record `id` field value. |
| `attachment_ids`<Requiredness type="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. |
</FieldTable>

## Request

<CodeExample title="">
```bash
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"
    }
]'
```
</CodeExample>

## Response

<CodeExample title="">
```json
{
    "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]"
                    }
                ]
            }
        ]
    }
}
```
</CodeExample>

## Response Details

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.

---

**Previous:** [Delete Object Record Attachment Version](/safety/vault-api/api-reference/26.3/vault-objects/object-record-attachments/delete-object-record-attachment-version)  
**Next:** [Retrieve Object Record Attachments Export Results](/safety/vault-api/api-reference/26.3/vault-objects/object-record-attachments/retrieve-object-record-attachments-export-results)