Document relations
Typed links between documents — a translation and its source, a revision and the one it replaces — and the relationship types a workspace defines for them.
List relationship types
The relationship types documents in this workspace can be linked with, as the administrator defined them. Each carries the label read from the document the link starts at (rt_name, "Translation of"), the label read from the other end (rt_inverse_name, "Translated as") and whether it reads the same from both ends (rt_symmetric).
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
query Parameters
cursor^[A-Za-z0-9_-]+$limitoffsetrt_namesort^-?[a-z0-9_]+$Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
List relationship types › Responses
Success
has_moreWhether more rows exist past this page.
next_cursorPass back as cursor for the next page. Null on the last page.
Add a relationship type
Defines a relationship type for documents: rt_name as the link reads from the document it is made on and rt_inverse_name as it reads from the other end. A symmetric type reads the same both ways and carries no inverse name; a directional type without one reuses rt_name from both ends. Names are unique within the workspace.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Add a relationship type › Request Body
rt_namert_inverse_namert_symmetricrt_descriptionAdd a relationship type › Responses
Created
rt_idrt_activert_createdrt_updatedrt_namert_inverse_namert_symmetricrt_descriptionReplace a relation type
Replaces the type's definition. Links already made with it keep pointing at it, so renaming a type relabels every link at once.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Replace a relation type › Request Body
rt_namert_inverse_namert_symmetricrt_descriptionReplace a relation type › Responses
Success
rt_idrt_activert_createdrt_updatedrt_namert_inverse_namert_symmetricrt_descriptionDelete a relation type
Removes the type and every link made with it. The documents themselves are untouched.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Delete a relation type › Responses
Success. No content.
List related documents
Every link this document takes part in, in both directions, each resolved to the document on the other end. label is the relationship type as it reads from here: a link written as "A is a translation of B" lists under B as "Translated as". A link to a document the caller may not read is left out.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idquery Parameters
cursor^[A-Za-z0-9_-]+$limitoffsetsort^-?[a-z0-9_]+$Headers
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
List related documents › Responses
Success
has_moreWhether more rows exist past this page.
next_cursorPass back as cursor for the next page. Null on the last page.
Link a document
Links this document to another one with a relationship type. direction is read from this document's side and defaults to from: this document is the one the type's label describes ("this is a translation of document_id"); to turns it around ("document_id is a translation of this"). The caller needs edit on both documents. Linking a pair that is already linked with the same type answers with the existing link; for a symmetric type that holds whichever way round it was written.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Link a document › Request Body
rel_typedocument_iddirectionrel_metadataLink a document › Responses
Created
rel_idrel_typerel_createdrel_created_byrel_metadatadirectionfrom when this document is the one the type's label describes, to when it is the one pointed at.
labelThe type's label as it reads from this document.
relation_typeThe relationship type: rt_id, rt_name, rt_inverse_name, rt_symmetric.
documentThe document on the other end: file_id, file_name, file_type, file_size, file_updated, file_deprecated.
Unlink a document
Removes one link. Both documents stay exactly as they were.
Requires the module-documents license feature. Without it the request is refused with 403 license_required — see plans and modules.
path Parameters
idrelation_idHeaders
X-Tenant-IdThe workspace this request acts in. Every row the API returns is isolated to it at the database layer by row-level security.
Unlink a document › Responses
Success. No content.
