Create Single Document Relationship
Create a new relationship on a document.
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/{document_id}/versions/{major_version_number__v}/{minor_version_number__v}/relationshipsHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/x-www-form-urlencoded |
Accept | application/json (default) or application/xml |
X-VaultAPI-MigrationMode | When set to true, creates a document relationship in migration mode. This allows developers to assign an inactive relationship type. You must have the Document Migration permission to use this header. Learn more about Document Migration Mode |
URI Path Parameters
Section link for URI Path Parameters| Name | Description |
|---|---|
{document_id} | The document id field value. |
{major_version_number__v} | The document major_version_number__v field value. |
{minor_version_number__v} | The document minor_version_number__v field value. |
Body Parameters
Section link for Body Parameters| Field Name | Description |
|---|---|
target_doc_id__vrequired | The document id of the target document. |
relationship_type__vrequired | The relationship type retrieved from the Document Relationships Metadata call above. |
target_major_version__vconditional | The major version number of the target document to which the source document will be bound. Required for target version-specific relationships. |
target_minor_version__vconditional | The minor version number of the target document to which the source document will be bound. Required for target version-specific relationships. |
Request
Section link for Requestcurl -X POST -H "Authorization: {AUTH_VALUE}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "target_doc_id__v=548" \
-d "relationship_type__v=supporting_documents__vs" \
-d "target_major_version__v=0" \
-d "target_minor_version__v=2" \
https://myvault.veevavault.com/api/v26.3/objects/documents/548/versions/0/1/relationshipsResponse
Section link for Response{
"responseStatus": "SUCCESS",
"responseMessage": "Document relationship successfully created.",
"id": 200
}Response Details
Section link for Response DetailsOn SUCCESS, Vault returns the ID of the newly created document relationship.