Skip to content

Retrieve all relationships from a document type.

GET/api/{version}/metadata/objects/documents/types/{type}/relationships
NameDescription
Acceptapplication/json (default) or application/xml
NameDescription
{type}The document type. See Retrieve Document Types.
curl -X GET -H "Authorization: {SESSION_ID}" \ https://myvault.veevavault.com/api/v19.3/metadata/objects/documents/types/promotional_piece__c/relationships
{ "responseStatus": "SUCCESS", "properties": [ { "name": "id", "type": "id", "length": 20, "editable": false, "queryable": true, "required": true, "multivalue": false, "onCreateEditable": false }, { "name": "source_doc_id__v", "type": "id", "length": 20, "editable": true, "queryable": true, "required": true, "multivalue": false, "onCreateEditable": true }, { "name": "source_major_version__v", "type": "Integer", "length": 10, "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": true }, { "name": "source_minor_version__v", "type": "Integer", "length": 10, "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": true }, { "name": "target_doc_id__v", "type": "id", "length": 20, "editable": false, "queryable": true, "required": true, "multivalue": false, "onCreateEditable": true }, { "name": "target_major_version__v", "type": "Integer", "length": 10, "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": true }, { "name": "target_minor_version__v", "type": "Integer", "length": 10, "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": true }, { "name": "relationship_type__v", "type": "String", "length": 255, "editable": false, "queryable": true, "required": true, "multivalue": false, "onCreateEditable": true }, { "name": "created_date__v", "type": "DateTime", "length": 0, "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": false }, { "name": "created_by__v", "type": "ObjectReference", "length": 10, "object": "users", "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": false }, { "name": "source_vault_id__v", "type": "id", "length": 20, "editable": false, "queryable": true, "required": false, "multivalue": false, "onCreateEditable": false } ], "relationshipTypes": [ { "value": "crosslink_document_latest__v", "label": "CrossLink Latest Bindings", "sourceDocVersionSpecific": true, "targetDocVersionSpecific": false, "system": true, "singleUse": false, "targetDocumentTypes": [ { "label": "Attachment", "value": "attachment__v" }, { "label": "Template Fragment", "value": "template_fragment__v" }, { "label": "Master Email Fragment", "value": "master_email_fragment__v" }, { "label": "Promotional Piece", "value": "promotional_piece__c" }, { "label": "Email Fragment", "value": "email_fragment__v" }, { "label": "Multichannel Presentation", "value": "engage_presentation__v" }, { "label": "Health Authority Form", "value": "health_authority_form__v" }, { "label": "Email Template", "value": "email_template__v" }, { "label": "Multichannel Slide", "value": "slide__v" }, { "label": "Compliance Package", "value": "compliance_package__v" }, { "label": "Undefined", "value": "undefined__v" } ] } ], "relationships": [ { "relationship_name": "source__vr", "relationship_label": "Source Relationship", "relationship_type": "reference_outbound", "object": { "name": "documents" } }, { "relationship_name": "target__vr", "relationship_label": "Target Relationship", "relationship_type": "reference_outbound", "object": { "name": "documents" } } ] }

The example response shows the metadata for the relationship type configured for the specified document promotional_piece__c.

The relationships object includes the following fields:

Field NameDescription
idThe relationship id field.
source_doc_id__vThe document id field of the source document on which the relationship is defined.
source_major_version__vThe major_version_number__v of the source document. This only applies when the target document is bound to a specific version of the source document.
source_minor_version__vThe minor_version_number__v of the source document. This only applies when the target document is bound to a specific version of the source document.
target_doc_id__vThe document id field of the target document which is bound to the source document.
target_major_version__vThe major_version_number__v of the target document. This only applies when the source document is bound to a specific version of the target document.
target_minor_version__vThe minor_version_number__v of the target document. This only applies when the source document is bound to a specific version of the target document.
relationship_type__vThe relationship type (basedon__c, supporting_documents__c, related_claims__c, related_pieces__c, etc.).
created_date__vThe date and time when the relationship is created.
created_by__vThe user id value of the person who creates the relationship.
source_vault_id__vThe Vault id value where the source document exists. Learn more.

Relationship types and their properties are configurable and vary from Vault to Vault.

Metadata FieldDescription
valueThe relationship type name (API key).
labelThe relationship type label.
sourceDocVersionSpecificIndicates whether or not the relationship type applies to a specific version of the source document. If false, the relationship type applies to all versions.
targetDocVersionSpecificIndicates whether or not the relationship type applies to a specific version of the target document. If false, the relationship type applies to all versions.
systemIndicates whether or not the relationship type is a standard Vault relationship type.
singleUseIndicates whether or not the relationship type can only be used once for each document.
targetDocumentTypesLists all document types which are valid target documents for the relationship type.

The source__vr and target__vr relationship names can be used to perform document relationship lookup queries.