Skip to content

Create new relationships on multiple documents.

  • The maximum 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 1000.

You cannot create or delete standard relationship types. Examples of standard relationship types include Based On and Original Source. Learn about document relationships in Vault Help.

POST/api/{version}/objects/documents/relationships/batch
NameDescription
Content-Typeapplication/json or text/csv
Acceptapplication/json (default) or text/csv

Create a JSON or CSV input file. There are multiple ways to create document relationships. The following standard fields are required to create document relationships.

NameDescription
source_doc_id__vDocument id value of the document on which the relationship is being created.
target_doc_id__vDocument id value of the document which is being associated with the source document as a related document.
relationship_type__vThe type of relationship the target document will have with the source document.
Download Input File
Create Source Version-Specific Relationships
Section link for Create Source Version-Specific Relationships

The following fields are required when creating a source version-specific relationship.

NameDescription
source_major_version__vThe major version number of the source document.
source_minor_version__vThe minor version number of the source document.
relationship_type__vThe type of relationship the target document will have with the source document.
Download Input File
Create Target Version-Specific Relationships
Section link for Create Target Version-Specific Relationships

The following fields are required when creating a target version-specific relationship.

NameDescription
target_major_version__vThe major version number of the target document to which the source document will be bound.
target_minor_version__vThe minor version number of the target document to which the source document will be bound.
relationship_type__vThe type of relationship the target document will have with the source document.
Download Input File
NameDescription
idParamTo create relationships based on an external id field, set to external_id__v. You must set Content-Type to text/csv and include an external_id__v column.
curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: text/csv" \ -H "Accept: text/csv" \ --data-binary @"C:\Vault\Document Relationships\document_relationships.csv" \ https://myvault.veevavault.com/api/v18.1/objects/documents/relationships/batch
{ "responseStatus": "SUCCESS", "data": [ { "responseStatus": "SUCCESS", "id": 10 }, { "responseStatus": "SUCCESS", "id": 11 }, ] }

On SUCCESS, Vault returns the IDs of the newly created document relationships.