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 RFC 4180 format, with some exceptions.
  • 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
X-VaultAPI-MigrationModeWhen set to true, creates a document relationship in migration mode. You must have the Document Migration permission to use this header. Learn more about Document Migration Mode in Vault Help.

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__v
required
Document id value of the document on which the relationship is being created.
target_doc_id__v
required
Document id value of the document which is being associated with the source document as a related document.
relationship_type__v
required
The type of relationship the target document will have with the source document.
Download Input File 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__v
required
The major version number of the source document.
source_minor_version__v
required
The minor version number of the source document.
relationship_type__v
required
The 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__v
required
The major version number of the target document to which the source document will be bound.
target_minor_version__v
required
The minor version number of the target document to which the source document will be bound.
relationship_type__v
required
The type of relationship the target document will have with the source document.
Download Input File
NameDescription
idParamTo create relationships based on an unique field, set idParam to a unique field name. You can use any object field which has unique set to true in the object metadata, with the exception of picklists. For example, idParam=external_id__v. You must then set Content-Type to text/csv and include your field name as a column.
curl -X POST -H "Authorization: {SESSION_ID}" \ -H "Content-Type: text/csv" \ -H "Accept: text/csv" \ --data-raw 'id,source_doc_id__v,source_major_version__v,source_minor_version__v,target_doc_id__v,relationship_type__v 7,17,1,6,42,supporting_documents__c 8,17,0,1,40,supporting_documents__c' \ https://myvault.veevavault.com/api/v26.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.