v1

latestOpenAPI 3.1.02026-08-066378446.6 KB
Document Operations

Link documents

<small>Requires an API token with the Document Manager role.</small>

Creates a relationship between the document referred to by the URL and another document. Allows representing relationships such as parent-child, amendment, renewal, etc. between documents.

The values that are sent in the request body will be normalised to create a "document relationship" where one of the documents is the "controller document" and the other is the "peripheral document". The resulting normalised relationship type will be one of the values defined in the DocumentRelationshipType enum. The normalised form of the relationship is what is returned in the response.

The following table shows how the different relationship types will be normalised and which role each of the documents will end up playing in the resulting relationship:

Request relationship_typeNormalised typeURL document's roleOther document's role
parent_ofparentcontroller_documentperipheral_document
child_ofparentperipheral_documentcontroller_document
amendment_toamendmentcontroller_documentperipheral_document
amended_byamendmentperipheral_documentcontroller_document
renewal_ofrenewalcontroller_documentperipheral_document
renewed_byrenewalperipheral_documentcontroller_document
addition_toadditioncontroller_documentperipheral_document
added_to_byadditionperipheral_documentcontroller_document
replacement_ofreplacementcontroller_documentperipheral_document
replaced_byreplacementperipheral_documentcontroller_document
termination_ofterminationcontroller_documentperipheral_document
terminated_byterminationperipheral_documentcontroller_document
post/documents/{document}/linked-documents

Path parameters

documentstring required

The document UUID

Request body

other_document_uuidstring uuid required

UUID of the document to link to

relationship_type'parent_of' | 'child_of' | 'amendment_to' | 'amended_by' | 'renewal_of' | 'renewed_by' | 'addition_to' | 'added_to_by' | 'replacement_of' | 'replaced_by' | 'termination_of' | 'terminated_by' required

Example request

{
  "other_document_uuid": "848b471e-2f1d-47c3-8c25-ad3f292097aa"
}

Response

DocumentRelationshipResource

Example response

{
  "data": {
    "uuid": "c9872112-75dd-4d57-93ea-b8a305eabadb",
    "controller_document": {
      "uuid": "4df1e60a-0114-4dce-89e7-8c5ad397fcf2",
      "name": "Kundenvertrag Muster GmbH",
      "locale": "de-AT",
      "template_uuid": "4df1e60a-0114-4dce-89e7-8c5ad397fcf2",
      "parties": [
        {
          "uuid": "595703a2-b7f6-4772-a4b7-ab2f9fac3a9f",
          "ref_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "reference": "Employer",
          "entity_name": "Demo Inc.",
          "address": "1 Oxford Road\nHenley Bridge\nHB1 1PQ"
        }
      ],
      "links": {
        "show": "https:...",
        "latest_revision_pdf": "https:...",
        "latest_revision_pdf_download": "https:..."
      }
    },
    "peripheral_document": {
      "uuid": "4df1e60a-0114-4dce-89e7-8c5ad397fcf2",
      "name": "Kundenvertrag Muster GmbH",
      "locale": "de-AT",
      "template_uuid": "4df1e60a-0114-4dce-89e7-8c5ad397fcf2",
      "parties": [
        {
          "uuid": "595703a2-b7f6-4772-a4b7-ab2f9fac3a9f",
          "ref_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "reference": "Employer",
          "entity_name": "Demo Inc.",
          "address": "1 Oxford Road\nHenley Bridge\nHB1 1PQ"
        }
      ],
      "links": {
        "show": "https:...",
        "latest_revision_pdf": "https:...",
        "latest_revision_pdf_download": "https:..."
      }
    }
  }
}