Update Multiple Documents
Bulk update editable field values on multiple documents. You can only update the latest version of each document. To update past document versions, see Update Document Version.
- The maximum CSV 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 1,000.
PUT
/api/{version}/objects/documents/batchHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | text/csv or application/x-www-form-urlencoded |
Accept | application/json (default) or text/csv |
X-VaultAPI-MigrationMode | When set to true, Vault allows you to change the document number. Vault does not send notifications in Document Migration Mode. All other Document Migration Mode overrides available at document creation are ignored, but do not generate an error message. You must have the Document Migration permission to use this header. Learn more about Document Migration Mode in Vault Help |
X-VaultAPI-NoTriggers | If set to true and Document Migration Mode |
Body Parameters
Section link for Body ParametersYou can use Name-Value pairs in the body of your request or upload a CSV file. id is the only required field, and you can update values of any editable document field. To find these fields, Retrieve Document Fields configured on documents. Editable fields will have editable:true. To remove existing field values, include the field name and set its value to null.
The following table includes required fields, and some optional document fields you may want to update:
| Name | Description |
|---|---|
idconditional | The ID of the document to update. Only required when uploading a CSV file. |
docIdsconditional | Comma-separated list of the IDs of documents to update. Only required when entering key-value pairs in the body of your request. |
archive__voptional | To archive a document, set to true. To unarchive a document, set to false. The default is false. Document archive is not available in all Vaults. Learn more in Vault Help. |
template_doctype__voptional | If you need to create a controlled document template from this document, enter a value for the Template Document Type field. To retrieve a list of all possible field values for this field, Retrieve the Object Collection for doc_type_detail__v. Learn more about controlled document template creation in Vault Help |
Request
Section link for Requestcurl -X PUT -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \
--data-raw 'id,product__v,country__v,language__v,audience__vs
771,00P1110,00C0001,English,Consumer
772,00P2220,00C0002,French,Healthcare Provider
773,00P3330,00C0003,Japanese,Managed Markets' \
https://myvault.veevavault.com/api/v26.1/objects/documents/batchResponse
Section link for Response{
"responseStatus": "SUCCESS",
"data": [
{
"responseStatus": "SUCCESS",
"id": 771,
"external_id__v": "ALT-DOC-0771"
},
{
"responseStatus": "SUCCESS",
"id": 772,
"external_id__v": "CHO-DOC-0772"
},
{
"responseStatus": "SUCCESS",
"id": 773,
"external_id__v": "GLU-DOC-0773"
}
]
}