Skip to main content
POST
Create a relation definition

Authorizations

Authorization
string
header
required

Sign in with the existing Occtoo Studio identity and selected organization.

Body

application/json

Holds a new relation definition.

id
string
required

Starts with a lowercase letter, then letters and digits (e.g. productVariants). It can't match a card property id of either card definition. Immutable.

name
string
required

Name of the relation definition.

sourceCardId
string
required

Raw id of the source card definition (e.g. products). It must be Active and differ from targetCardId. Immutable.

targetCardId
string
required

Raw id of the target card definition (e.g. variants). It must be Active. Immutable.

match
object
required

The card properties whose values link a source card to its target cards. Both must be indexed Text or List card properties (not both List, no format-only conversions) or id.

description
null | string

Free-text note about the relation definition.

tags
null | string[]

Labels for grouping and filtering relation definitions.

sourceDisplayName
null | string

Label for the relation on the source side, up to 255 characters.

targetDisplayName
null | string

Label for the relation on the target side, up to 255 characters.

order
null | object

How the target cards related to a source card are ordered. Omitted = no order.

Response

Created

Links the cards of two card definitions, a source and a target. Segments (relation in where) and destination endpoints (relation content) follow relation definitions by id.

id
string
required

Raw id of the relation definition (e.g. productVariants). Use with /v1/relation-definitions/{relationId}.

name
string
required

Name of the relation definition.

description
null | string
required

Free-text note about the relation definition.

tags
string[]
required

Labels for grouping and filtering relation definitions.

sourceCardId
string
required

Raw id of the source card definition (e.g. products).

targetCardId
string
required

Raw id of the target card definition (e.g. variants).

match
object
required

The card properties whose values link a source card to its target cards.

sourceDisplayName
null | string
required

Label for the relation on the source side (e.g. Variants). Null when not set.

targetDisplayName
null | string
required

Label for the relation on the target side (e.g. Variant of). Null when not set.

order
null | object
required

How the target cards related to a source card are ordered. Null = no order set.

status
enum<string>
required

Whether the links between cards are built. See RelationDefinitionStatus.

Available options:
Initializing,
Updating,
Active
createdAt
string<date-time>
required

When the relation definition was created (UTC).

updatedAt
string<date-time>
required

When the relation definition last changed (UTC).