Open Inventory / Docs
EndpointsInventory structureRelation types

Create a relationship type

The API runs on your application instance. Schemas and field names come directly from the OpenAPI specification. Session-authenticated requests require a session on that instance.

POST
/relation-types

Requires an authenticated administrator browser session.

Authorization

adminSession
cookieauthjs.session-token<token>

Authenticated Auth.js browser session cookie; each operation declares its required permission. Not restricted to administrators. HTTPS deployments use the secure-prefixed cookie variant.

Header Parameters

X-Organization-ID?string

Organization membership selected for this request. User-bound credentials may select any active membership; standalone tokens may only repeat their pinned organization ID.

Formatuuid

Request Body

application/json
  1. body
key*string

Stable key of an administrator-configurable directed relationship type.

Match^[a-z][a-z0-9_-]{0,63}$
Length1 <= length <= 64
label*string
Length1 <= length <= 120
inverseLabel*string
Length1 <= length <= 120
description?string
Lengthlength <= 5000
Default""
allowManual?boolean
Defaulttrue
position?integer
Range0 <= value <= 100000
Default0

Response Body

Relationship type created

application/json
  1. response
relationType*
Example Request
curl -X POST 'https://inventory.example.com/api/v1/relation-types' \  -H 'Content-Type: application/json' \  -d '{  "key": "string",  "label": "string",  "inverseLabel": "string"}'
Example Response
{  "relationType": {    "key": "string",    "label": "string",    "inverseLabel": "string",    "description": "string",    "allowManual": true,    "spatial": true,    "position": 0,    "isSystem": true,    "createdBy": "string",    "updatedBy": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "archivedAt": "2019-08-24T14:15:22Z"  }}