Create a relation type.
POST/api/v1/graph/relation-typescustom_fields:write
Adds a relation type under a code of 2 to 40 capital letters, digits and underscores starting with a letter (409 already_exists when taken). from_kinds and to_kinds hold document and/or register_row. Needs Create Graph Relation Types.
| Scope | custom_fields:write |
| Asynchronous | No |
| MCP tool | create_graph_relation_type |
| Portal permissions | create_graph_relation_types |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Docwize-Version | header | string (date) | Optional | |
Idempotency-Key | header | string | Optional | max 255 |
Request body
| Content type | Type |
|---|---|
application/json | GraphRelationTypeCreateInput |
Responses
| Status | Description | Body |
|---|---|---|
201 | Success. | application/json GraphRelationType or object |
400 | invalid_version, malformed_json | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
409 | already_exists, idempotency_in_progress | application/problem+json Problem |
413 | payload_too_large | application/problem+json Problem |
415 | unsupported_media_type | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | idempotency_key_reused, validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
GraphRelationType
| Field | Type | Required | Description |
|---|---|---|---|
category | string or null | Required | |
color | string or null | Required | |
decision_category | string or null | Required | |
derivation | string or null | Required | Set for a relation type the engine derives (it cannot be deleted). |
external_code | string or null | Required | |
from_kinds | array of string | Required | What the relation can start from: document, register_row. |
impact_direction | string or null | Required | Set with impact_weight. |
impact_weight | number or null | Required | Above 0 up to 1, for an impact edge; null when the relation is not one. |
inverse_label | string or null | Required | How the relation reads from the other end; null when it reads the same. |
is_active | boolean | Required | |
is_symmetric | boolean | Required | |
is_transitive | boolean | Required | |
label | string | Required | |
navigation_audience | string or null | Required | Who sees the relation when navigating: all or analyst. |
relation_type_id | string | Required | The code, 2 to 40 capital letters, digits and underscores. |
to_custom_field_template_id | string or null | Required | The register a relation ends at, when it is fixed. |
to_kinds | array of string | Required | What the relation can end at: document, register_row. |
used_by | array of GraphUse | Required | The fields and templates configured to use the relation type. |
GraphRelationTypeCreateInput
| Field | Type | Required | Description |
|---|---|---|---|
category | string or null | Optional | Up to 40 characters. |
color | string or null | Optional | Up to 20 characters. |
decision_category | string or null | Optional | |
external_code | string or null | Optional | Up to 100 characters. |
from_kinds | array of string | Optional | document and/or register_row. Both when left out. |
impact_direction | string or null | Optional | |
impact_weight | number or null | Optional | Above 0 up to 1; send with impact_direction. |
inverse_label | string or null | Optional | Up to 100 characters. |
is_active | boolean or null | Optional | True when left out. |
is_symmetric | boolean or null | Optional | False when left out. |
is_transitive | boolean or null | Optional | False when left out. |
label | string | Required | Up to 100 characters. |
navigation_audience | string or null | Optional | all or analyst. |
relation_type_id | string | Required | The code: 2 to 40 capital letters, digits and underscores, starting with a letter. |
to_custom_field_template_id | string or null | Optional | |
to_kinds | array of string | Optional | document and/or register_row. Both when left out. |
GraphUse
| Field | Type | Required | Description |
|---|---|---|---|
custom_field_id | string or null | Required | The field; null for a template-level use. |
custom_field_template_id | string or null | Required | The template; null for a use outside a template. |
label | string | Required | The template, or the template and field, as the builder names it. |
where | string or null | Required | For a normaliser: field_role or document_link, or null. |