**Source URL:** https://limited.veevavault.dev/safety/vault-api/api-reference/21.3/documents/document-relationships/create-multiple-document-relationships.md

# Create Multiple Document Relationships



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](/vault-api/references/csv-rfc-deviations).

* 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](https://platform.veevavault.help/en/lr/21330).

<Endpoint path="/api/{version}/objects/documents/relationships/batch" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Content-Type` | `application/json` or `text/csv` |
| `Accept` | `application/json` (default) or `text/csv` |
</FieldTable>

## Body Parameters {#body-parameters}

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.

<FieldTable>
| Name | Description |
| --- | --- |
| `source_doc_id__v` | Document `id` value of the document on which the relationship is being created. |
| `target_doc_id__v` | Document `id` value of the document which is being associated with the source document as a related document. |
| `relationship_type__v` | The type of relationship the target document will have with the source document. |
</FieldTable>
<DownloadButton href="/sample-files/vault-create-doc-relationship-sample-csv-input.csv" label="Download Input File"></DownloadButton>
<DownloadButton href="/sample-files/bulk-create-document-relationships.json" label="Download Input File"></DownloadButton>

##### Create Source Version-Specific Relationships {#create-source-version-specific-relationships}

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

<FieldTable>
| Name | Description |
| --- | --- |
| `source_major_version__v` | The major version number of the source document. |
| `source_minor_version__v` | The minor version number of the source document. |
| `relationship_type__v` | The type of relationship the target document will have with the source document. |
</FieldTable>
<DownloadButton href="/sample-files/vault-create-source-version-specific-relationship-sample-csv-input.csv" label="Download Input File"></DownloadButton>

##### Create Target Version-Specific Relationships {#create-target-version-specific-relationships}

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

<FieldTable>
| Name | Description |
| --- | --- |
| `target_major_version__v` | The major version number of the target document to which the source document will be bound. |
| `target_minor_version__v` | The minor version number of the target document to which the source document will be bound. |
| `relationship_type__v` | The type of relationship the target document will have with the source document. |
</FieldTable>
<DownloadButton href="/sample-files/vault-create-target-version-specific-relationship-sample-csv-input.csv" label="Download Input File"></DownloadButton>

## Query Parameters {#query-parameters}

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

## Request {#request}

<CodeExample title="">
```
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/v15.0/objects/documents/relationships/batch

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "id": 10
        },
        {
            "responseStatus": "SUCCESS",
            "id": 11
        },
    ]
}

```
</CodeExample>

## Response Details {#response-details}

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



---

**Previous:** [Create Single Document Relationship](/safety/vault-api/api-reference/21.3/documents/document-relationships/create-single-document-relationship)  
**Next:** [Retrieve Document Relationship](/safety/vault-api/api-reference/21.3/documents/document-relationships/retrieve-document-relationship)