Skip to content

This endpoint allows you to create multiple documents at once with a CSV input file.

  • The maximum CSV input file size is 1GB.
  • The values in the input must be UTF-8 encoded.
  • CSVs must follow the standard format.
  • The maximum batch size is 500.
POST/api/{version}/objects/documents/batch
NameDescription
Content-Typetext/csv
Acceptapplication/json (default) or text/csv

Prepare a CSV input file. There are multiple ways to create documents in bulk. The following shows the required standard fields needed to create documents, but an Admin may set other standard or custom document fields as required in your Vault. To find which fields are required, retrieve document fields. You can also optionally include any editable document field.

Create Documents from Uploaded Files
Section link for Create Documents from Uploaded Files

You must first upload the document source files to your Vault's FTP staging server.

NameDescription
fileThe filepath of the source document. The maximum allowed file size is 4GB.
name__vThe name of the new document.
type__vThe name of the document type to assign to the new document.
subtype__vThe name of the document subtype (if one exists on the document type).
classification__vThe name of the document classification (if one exists on the document subtype).
lifecycle__vThe name of the document lifecycle to assign to the new document.
major_version_number__vThe major version number to assign to the new document
minor_version_number__vThe minor version number to assign to the new document.
suppressRenditionOptional: false by default. Set to true to suppress generation of viewable renditions.
product__vExample: This is an example object reference field. To assign value for this field type, include either the document field name product__v or the document field name plus the name field on the object product__v.name__v.
Download Input File

When you create a new document from a template, Vault copies the template file in your Vault and uses that copy as the source file for the new document.

NameDescription
fromTemplateThe template to apply to the document.
name__vThe name of the new document.
type__vThe name of the document type to assign to the new document.
subtype__vThe name of the document subtype (if one exists on the document type).
classification__vThe name of the document classification (if one exists on the document subtype).
lifecycle__vThe name of the document lifecycle to assign to the new document.
major_version_number__vThe major version number to assign to the new document
minor_version_number__vThe minor version number to assign to the new document.
product__vExample: This is an example object reference field. To assign value for this field type, include either the document field name product__v or the document field name plus the name field on the object product__v.name__v.
Download Input File
Create Content Placeholder Documents
Section link for Create Content Placeholder Documents

Vault allows you to create content placeholders when the associated file is not yet available. You can add the source document at a later date.

NameDescription
fileInclude this column in your input, but leave the values blank.
name__vThe name of the new document.
type__vThe name of the document type to assign to the new document.
subtype__vThe name of the document subtype (if one exists on the document type).
classification__vThe name of the document classification (if one exists on the document subtype).
lifecycle__vThe name of the document lifecycle to assign to the new document.
major_version_number__vThe major version number to assign to the new document
minor_version_number__vThe minor version number to assign to the new document.
Download Input File

Unclassified documents are documents which have a source file, but no document type. The following fields are required, but you can include any editable document field.

NameDescription
fileThe filepath of the source document. The maximum allowed file size is 4GB.
name__vThe name of the new document.
type__vSet the document type to Undefined
lifecycle__vSet the document lifecycle to Unclassified
Download Input File
curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: text/csv" \ -H "Accept: text/csv" \ --data-binary @"C:\Vault\Documents\create_documents.csv" \ https://myvault.veevavault.com/api/v17.2/objects/documents/batch
{ "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" }, { "responseStatus": "FAILURE" "errors": [ { "type": "INVALID_DATA", "message": "Error message describing why this document was not created." } ] } ] }