{
    "openapi": "3.1.0",
    "info": {
        "title": "Salescore",
        "version": "1.0.0",
        "description": "Salescore core API: identity, tenancy, authorization, module access and audit for an API-first multi-tenant CRM."
    },
    "servers": [
        {
            "url": "https:\/\/api.salescore.tech\/api\/v1"
        }
    ],
    "paths": {
        "\/core\/audit": {
            "get": {
                "operationId": "v1.core.audit.index",
                "tags": [
                    "Audit"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `AuditEventResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/AuditEventResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The \"cursor\" that points to the next set of items."
                                                },
                                                "prev_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The \"cursor\" that points to the previous set of items."
                                                }
                                            },
                                            "required": [
                                                "path",
                                                "per_page",
                                                "next_cursor",
                                                "prev_cursor"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/platform\/audit": {
            "get": {
                "operationId": "v1.platform.audit.index",
                "tags": [
                    "Audit"
                ],
                "parameters": [
                    {
                        "name": "target_tenant_id",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `AuditEventResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/AuditEventResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The \"cursor\" that points to the next set of items."
                                                },
                                                "prev_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The \"cursor\" that points to the previous set of items."
                                                }
                                            },
                                            "required": [
                                                "path",
                                                "per_page",
                                                "next_cursor",
                                                "prev_cursor"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts": {
            "get": {
                "operationId": "v1.contacts.index",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "schema": {
                            "$ref": "#\/components\/schemas\/ContactKind"
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "owner_id",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "organization_id",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "do_not_contact",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "include_deleted",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "display_name",
                                "-display_name",
                                "created_at",
                                "-created_at",
                                "updated_at",
                                "-updated_at"
                            ]
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/ContactResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "primary_email",
                                                            "primary_phone",
                                                            "identities"
                                                        ]
                                                    }
                                                ]
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The \"cursor\" that points to the next set of items."
                                                },
                                                "prev_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The \"cursor\" that points to the previous set of items."
                                                }
                                            },
                                            "required": [
                                                "path",
                                                "per_page",
                                                "next_cursor",
                                                "prev_cursor"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.contacts.store",
                "tags": [
                    "Contact"
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ContactResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "primary_email",
                                                        "primary_phone",
                                                        "identities",
                                                        "addresses"
                                                    ]
                                                }
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "duplicates": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "duplicates"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}": {
            "get": {
                "operationId": "v1.contacts.show",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ContactResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "primary_email",
                                                        "primary_phone",
                                                        "identities",
                                                        "addresses"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "patch": {
                "operationId": "v1.contacts.update",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ContactResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "primary_email",
                                                        "primary_phone",
                                                        "identities",
                                                        "addresses"
                                                    ]
                                                }
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "duplicates": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "duplicates"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.contacts.destroy",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/restore": {
            "post": {
                "operationId": "v1.contacts.restore",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ContactResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "primary_email",
                                                        "primary_phone",
                                                        "identities",
                                                        "addresses"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/owner": {
            "put": {
                "operationId": "v1.contacts.owner",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "owner_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "uuid"
                                    }
                                },
                                "required": [
                                    "owner_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ContactResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "primary_email",
                                                        "primary_phone",
                                                        "identities",
                                                        "addresses"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/identities": {
            "get": {
                "operationId": "v1.contacts.identities.index",
                "tags": [
                    "ContactIdentity"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ContactIdentityResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ContactIdentityResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.contacts.identities.store",
                "tags": [
                    "ContactIdentity"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreIdentityRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ContactIdentityResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ContactIdentityResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/identities\/{identity}": {
            "patch": {
                "operationId": "v1.contacts.identities.update",
                "tags": [
                    "ContactIdentity"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "identity",
                        "in": "path",
                        "required": true,
                        "description": "The identity ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateIdentityRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ContactIdentityResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ContactIdentityResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.contacts.identities.destroy",
                "tags": [
                    "ContactIdentity"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "identity",
                        "in": "path",
                        "required": true,
                        "description": "The identity ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/lookup": {
            "post": {
                "operationId": "v1.contacts.lookup",
                "tags": [
                    "ContactLookup"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/LookupRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ContactResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "primary_email",
                                                        "primary_phone",
                                                        "identities",
                                                        "addresses"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/upsert": {
            "post": {
                "operationId": "v1.contacts.upsert",
                "tags": [
                    "ContactLookup"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpsertContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/duplicates\/check": {
            "post": {
                "operationId": "v1.contacts.duplicates.check",
                "tags": [
                    "ContactLookup"
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/duplicates": {
            "get": {
                "operationId": "v1.contacts.duplicates",
                "tags": [
                    "ContactLookup"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/shares": {
            "get": {
                "operationId": "v1.contacts.shares.index",
                "tags": [
                    "ContactShare"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ContactShareResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ContactShareResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.contacts.shares.store",
                "tags": [
                    "ContactShare"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ShareRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ContactShareResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ContactShareResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}\/shares\/{user}": {
            "delete": {
                "operationId": "v1.contacts.shares.destroy",
                "tags": [
                    "ContactShare"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/tags": {
            "get": {
                "operationId": "v1.contacts.tags.index",
                "tags": [
                    "ContactTag"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "tag": {
                                                        "type": "string"
                                                    },
                                                    "contacts": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "required": [
                                                    "tag",
                                                    "contacts"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/contacts\/tags\/{tag}\/shares": {
            "get": {
                "operationId": "v1.contacts.tags.shares.index",
                "tags": [
                    "ContactTag"
                ],
                "parameters": [
                    {
                        "name": "tag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ContactTagShareResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ContactTagShareResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.contacts.tags.shares.store",
                "tags": [
                    "ContactTag"
                ],
                "parameters": [
                    {
                        "name": "tag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/TagShareRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ContactTagShareResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ContactTagShareResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/tags\/{tag}\/shares\/{share}": {
            "delete": {
                "operationId": "v1.contacts.tags.shares.destroy",
                "tags": [
                    "ContactTag"
                ],
                "parameters": [
                    {
                        "name": "tag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "share",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/tenant": {
            "get": {
                "operationId": "v1.core.tenant.show",
                "tags": [
                    "CurrentTenant"
                ],
                "responses": {
                    "200": {
                        "description": "`TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/exports": {
            "get": {
                "operationId": "v1.core.exports.index",
                "tags": [
                    "DataExport"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `DataExportResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/DataExportResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.exports.store",
                "tags": [
                    "DataExport"
                ],
                "responses": {
                    "202": {
                        "description": "`DataExportResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/DataExportResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/exports\/{export}": {
            "get": {
                "operationId": "v1.core.exports.show",
                "tags": [
                    "DataExport"
                ],
                "parameters": [
                    {
                        "name": "export",
                        "in": "path",
                        "required": true,
                        "description": "The export ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`DataExportResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/DataExportResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/exports\/{export}\/download": {
            "get": {
                "operationId": "v1.core.exports.download",
                "summary": "Streams the decrypted archive. Authentication and permission already passed; the row\nbeing visible at all means it belongs to the current tenant",
                "tags": [
                    "DataExport"
                ],
                "parameters": [
                    {
                        "name": "export",
                        "in": "path",
                        "required": true,
                        "description": "The export ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Transfer-Encoding": {
                                "required": true,
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "chunked"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/devices": {
            "get": {
                "operationId": "v1.core.auth.devices.index",
                "tags": [
                    "Device"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `DeviceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/DeviceResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/devices\/{device}": {
            "patch": {
                "operationId": "v1.core.auth.devices.update",
                "tags": [
                    "Device"
                ],
                "parameters": [
                    {
                        "name": "device",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateDeviceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`DeviceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/DeviceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.core.auth.devices.destroy",
                "tags": [
                    "Device"
                ],
                "parameters": [
                    {
                        "name": "device",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/invitations\/accept": {
            "post": {
                "operationId": "v1.core.invitations.accept",
                "summary": "Runs under a provisional tenant context (the invitee is not a member yet). A signed-in\nuser simply joins; a signed-out one gets an account if needed and is signed in like a\nmagic link would",
                "tags": [
                    "Invitation"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/AcceptInvitationRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/MembershipResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "roles"
                                                    ]
                                                }
                                            ]
                                        },
                                        "tenant": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        },
                                        "user": {
                                            "$ref": "#\/components\/schemas\/UserResource"
                                        },
                                        "device": {
                                            "$ref": "#\/components\/schemas\/DeviceResource"
                                        },
                                        "plain_text_token": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "tenant",
                                        "user",
                                        "device",
                                        "plain_text_token"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/invitations": {
            "get": {
                "operationId": "v1.core.invitations.index",
                "tags": [
                    "Invitation"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `InvitationResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/InvitationResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.invitations.store",
                "tags": [
                    "Invitation"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreInvitationRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`InvitationResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/InvitationResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/invitations\/{invitation}": {
            "delete": {
                "operationId": "v1.core.invitations.destroy",
                "tags": [
                    "Invitation"
                ],
                "parameters": [
                    {
                        "name": "invitation",
                        "in": "path",
                        "required": true,
                        "description": "The invitation ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/listings": {
            "get": {
                "operationId": "v1.listings.index",
                "tags": [
                    "Listing"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ListingResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ListingResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.listings.store",
                "tags": [
                    "Listing"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreListingRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ListingResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ListingResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/listings\/{listing}": {
            "get": {
                "operationId": "v1.listings.show",
                "tags": [
                    "Listing"
                ],
                "parameters": [
                    {
                        "name": "listing",
                        "in": "path",
                        "required": true,
                        "description": "The listing ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ListingResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ListingResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/listings\/{listing}\/publish": {
            "post": {
                "operationId": "v1.listings.publish",
                "tags": [
                    "Listing"
                ],
                "parameters": [
                    {
                        "name": "listing",
                        "in": "path",
                        "required": true,
                        "description": "The listing ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ListingResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ListingResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/logout": {
            "post": {
                "operationId": "v1.core.auth.logout",
                "tags": [
                    "Logout"
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/magic-link": {
            "post": {
                "operationId": "v1.core.auth.magic-link.store",
                "summary": "Always answers 202 so the response does not reveal whether the email is registered or\nbelongs to an operator. Links to the operator console are only sent to operators",
                "tags": [
                    "MagicLink"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/RequestMagicLinkRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": ""
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/auth\/magic-link\/consume": {
            "post": {
                "operationId": "v1.core.auth.magic-link.consume",
                "summary": "Redeem the token. The first-party SPA gets a cookie session; a mobile app registers its\ndevice and gets a bearer token, returned once",
                "tags": [
                    "MagicLink"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ConsumeMagicLinkRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`UserResource`\n\n`UserResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#\/components\/schemas\/UserResource"
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#\/components\/schemas\/UserResource"
                                                },
                                                "device": {
                                                    "$ref": "#\/components\/schemas\/DeviceResource"
                                                },
                                                "plain_text_token": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "device",
                                                "plain_text_token"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/auth\/me": {
            "get": {
                "operationId": "v1.core.auth.me",
                "tags": [
                    "Me"
                ],
                "responses": {
                    "200": {
                        "description": "`ServiceAccountResource`\n\n`UserResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#\/components\/schemas\/ServiceAccountResource"
                                                },
                                                "actor_type": {
                                                    "type": "string",
                                                    "const": "service_account"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "actor_type"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#\/components\/schemas\/UserResource"
                                                },
                                                "actor_type": {
                                                    "type": "string",
                                                    "const": "user"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "actor_type"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/members\/leave": {
            "post": {
                "operationId": "v1.core.members.leave",
                "tags": [
                    "Member"
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/members": {
            "get": {
                "operationId": "v1.core.members.index",
                "tags": [
                    "Member"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `MembershipResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/MembershipResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "user",
                                                            "roles"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/members\/{membership}": {
            "delete": {
                "operationId": "v1.core.members.destroy",
                "tags": [
                    "Member"
                ],
                "parameters": [
                    {
                        "name": "membership",
                        "in": "path",
                        "required": true,
                        "description": "The membership ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/members\/{membership}\/roles": {
            "put": {
                "operationId": "v1.core.members.roles",
                "tags": [
                    "Member"
                ],
                "parameters": [
                    {
                        "name": "membership",
                        "in": "path",
                        "required": true,
                        "description": "The membership ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/AssignRolesRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`MembershipResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/MembershipResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "user",
                                                        "roles"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/platform\/modules": {
            "get": {
                "operationId": "v1.platform.modules.index",
                "tags": [
                    "Module"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ModuleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ModuleResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/platform\/tenants\/{tenant}\/modules": {
            "get": {
                "operationId": "v1.platform.tenants.modules.index",
                "tags": [
                    "Module"
                ],
                "parameters": [
                    {
                        "name": "tenant",
                        "in": "path",
                        "required": true,
                        "description": "The tenant ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/platform\/tenants\/{tenant}\/modules\/{module}": {
            "put": {
                "operationId": "v1.platform.tenants.modules.update",
                "tags": [
                    "Module"
                ],
                "parameters": [
                    {
                        "name": "tenant",
                        "in": "path",
                        "required": true,
                        "description": "The tenant ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "module",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/SetEntitlementRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/platform\/operators": {
            "get": {
                "operationId": "v1.platform.operators.index",
                "tags": [
                    "Operator"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `OperatorResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/OperatorResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "roles"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.platform.operators.store",
                "tags": [
                    "Operator"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreOperatorRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/platform\/operators\/{user}": {
            "delete": {
                "operationId": "v1.platform.operators.destroy",
                "tags": [
                    "Operator"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "description": "The user ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/org\/members\/{membership}\/reporting-line": {
            "get": {
                "operationId": "v1.core.org.members.reporting-line",
                "summary": "The seats above a member, nearest first; a vacant step has no holder",
                "tags": [
                    "OrgMember"
                ],
                "parameters": [
                    {
                        "name": "membership",
                        "in": "path",
                        "required": true,
                        "description": "The membership ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/org\/members\/move": {
            "post": {
                "operationId": "v1.core.org.members.move",
                "tags": [
                    "OrgMember"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/MoveOrgMemberRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/org\/overview": {
            "get": {
                "operationId": "v1.core.org.overview",
                "summary": "The whole chart in one payload: the units in tree order with their roster and current\napprover, every active member, and the bench (members sitting on no unit)",
                "tags": [
                    "OrgOverview"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "units": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "parent_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "code": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "sort_order": {
                                                                "type": "integer"
                                                            },
                                                            "lead_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "deputy_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "admin_ids": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "member_ids": {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            "approver": {
                                                                "type": [
                                                                    "object",
                                                                    "null"
                                                                ],
                                                                "properties": {
                                                                    "user_id": {
                                                                        "type": "string"
                                                                    },
                                                                    "membership_id": {
                                                                        "type": "string"
                                                                    },
                                                                    "unit_id": {
                                                                        "type": "string"
                                                                    },
                                                                    "seat": {
                                                                        "type": "string"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "user_id",
                                                                    "membership_id",
                                                                    "unit_id",
                                                                    "seat"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "kind",
                                                            "name",
                                                            "parent_id",
                                                            "code",
                                                            "active",
                                                            "description",
                                                            "sort_order",
                                                            "lead_id",
                                                            "deputy_id",
                                                            "admin_ids",
                                                            "member_ids",
                                                            "approver"
                                                        ]
                                                    }
                                                },
                                                "people": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "membership_id": {
                                                                "type": "string"
                                                            },
                                                            "user_id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "seats": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "unit_id": {
                                                                            "type": "string"
                                                                        },
                                                                        "role": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "unit_id",
                                                                        "role"
                                                                    ]
                                                                }
                                                            }
                                                        },
                                                        "required": [
                                                            "membership_id",
                                                            "user_id",
                                                            "name",
                                                            "email",
                                                            "seats"
                                                        ]
                                                    }
                                                },
                                                "bench_ids": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "units",
                                                "people",
                                                "bench_ids"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/org\/units": {
            "get": {
                "operationId": "v1.core.org.units.index",
                "summary": "Every unit in tree order (parents before children); `?kind=` and `?parent_id=` narrow it",
                "tags": [
                    "OrgUnit"
                ],
                "parameters": [
                    {
                        "name": "parent_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `OrgUnitResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/OrgUnitResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.org.units.store",
                "tags": [
                    "OrgUnit"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreOrgUnitRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`OrgUnitResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/OrgUnitResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/org\/units\/{unit}\/members": {
            "get": {
                "operationId": "v1.core.org.units.members.index",
                "tags": [
                    "OrgUnit"
                ],
                "parameters": [
                    {
                        "name": "unit",
                        "in": "path",
                        "required": true,
                        "description": "The unit ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `OrgUnitMemberResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/OrgUnitMemberResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "user"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "v1.core.org.units.members.set",
                "tags": [
                    "OrgUnit"
                ],
                "parameters": [
                    {
                        "name": "unit",
                        "in": "path",
                        "required": true,
                        "description": "The unit ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/SetOrgUnitMembersRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Array of `OrgUnitMemberResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/OrgUnitMemberResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "user"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/org\/units\/order": {
            "put": {
                "operationId": "v1.core.org.units.order",
                "tags": [
                    "OrgUnit"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ReorderOrgUnitsRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/org\/units\/{unit}": {
            "patch": {
                "operationId": "v1.core.org.units.update",
                "tags": [
                    "OrgUnit"
                ],
                "parameters": [
                    {
                        "name": "unit",
                        "in": "path",
                        "required": true,
                        "description": "The unit ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateOrgUnitRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`OrgUnitResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/OrgUnitResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.core.org.units.destroy",
                "tags": [
                    "OrgUnit"
                ],
                "parameters": [
                    {
                        "name": "unit",
                        "in": "path",
                        "required": true,
                        "description": "The unit ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/platform\/roles": {
            "get": {
                "operationId": "v1.platform.roles.index",
                "tags": [
                    "PlatformRole"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `PlatformRoleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/PlatformRoleResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "permissions"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/roles": {
            "get": {
                "operationId": "v1.core.roles.index",
                "tags": [
                    "Role"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `RoleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/RoleResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "permissions"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.roles.store",
                "tags": [
                    "Role"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreRoleRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`RoleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/RoleResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "permissions"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/permissions": {
            "get": {
                "operationId": "v1.core.permissions.index",
                "summary": "Tenant-scope permissions a role may be given. Entitlement filtering joins here with modules",
                "tags": [
                    "Role"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `PermissionResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/PermissionResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/roles\/{role}": {
            "patch": {
                "operationId": "v1.core.roles.update",
                "tags": [
                    "Role"
                ],
                "parameters": [
                    {
                        "name": "role",
                        "in": "path",
                        "required": true,
                        "description": "The role ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateRoleRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`RoleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/RoleResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "permissions"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.core.roles.destroy",
                "tags": [
                    "Role"
                ],
                "parameters": [
                    {
                        "name": "role",
                        "in": "path",
                        "required": true,
                        "description": "The role ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/service-accounts": {
            "get": {
                "operationId": "v1.core.service-accounts.index",
                "tags": [
                    "ServiceAccount"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ServiceAccountResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/ServiceAccountResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "roles"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.service-accounts.store",
                "tags": [
                    "ServiceAccount"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreServiceAccountRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ServiceAccountResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ServiceAccountResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "roles"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/service-accounts\/{serviceAccount}": {
            "patch": {
                "operationId": "v1.core.service-accounts.update",
                "tags": [
                    "ServiceAccount"
                ],
                "parameters": [
                    {
                        "name": "serviceAccount",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateServiceAccountRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ServiceAccountResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ServiceAccountResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "roles"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.core.service-accounts.destroy",
                "tags": [
                    "ServiceAccount"
                ],
                "parameters": [
                    {
                        "name": "serviceAccount",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/service-accounts\/{serviceAccount}\/roles": {
            "put": {
                "operationId": "v1.core.service-accounts.roles",
                "tags": [
                    "ServiceAccount"
                ],
                "parameters": [
                    {
                        "name": "serviceAccount",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/AssignRolesRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ServiceAccountResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ServiceAccountResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "roles"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/service-accounts\/{serviceAccount}\/tokens": {
            "get": {
                "operationId": "v1.core.service-accounts.tokens.index",
                "tags": [
                    "ServiceAccount"
                ],
                "parameters": [
                    {
                        "name": "serviceAccount",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `TokenResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/TokenResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.service-accounts.tokens.store",
                "tags": [
                    "ServiceAccount"
                ],
                "parameters": [
                    {
                        "name": "serviceAccount",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreServiceAccountTokenRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`TokenResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TokenResource"
                                        },
                                        "plain_text_token": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "plain_text_token"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/service-accounts\/{serviceAccount}\/tokens\/{token}": {
            "delete": {
                "operationId": "v1.core.service-accounts.tokens.destroy",
                "tags": [
                    "ServiceAccount"
                ],
                "parameters": [
                    {
                        "name": "serviceAccount",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/sessions": {
            "get": {
                "operationId": "v1.core.auth.sessions.index",
                "tags": [
                    "Session"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `SessionResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/SessionResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.core.auth.sessions.destroy-all",
                "summary": "Sign out everywhere: every browser session including this one and every registered\ndevice; with ?include_tokens=1 the integration tokens as well. The caller must\nauthenticate again afterwards",
                "tags": [
                    "Session"
                ],
                "parameters": [
                    {
                        "name": "include_tokens",
                        "in": "query",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/sessions\/others": {
            "delete": {
                "operationId": "v1.core.auth.sessions.destroy-others",
                "summary": "Revoke every session except the current one, and cycle the remember token so\n\"remember me\" cookies on other devices stop working too",
                "tags": [
                    "Session"
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/auth\/sessions\/{session}": {
            "delete": {
                "operationId": "v1.core.auth.sessions.destroy",
                "tags": [
                    "Session"
                ],
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/platform\/tenants": {
            "get": {
                "operationId": "v1.platform.tenants.index",
                "tags": [
                    "Tenant"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "$ref": "#\/components\/schemas\/TenantStatus"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/TenantResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.platform.tenants.store",
                "tags": [
                    "Tenant"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreTenantRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/platform\/tenants\/{tenant}": {
            "get": {
                "operationId": "v1.platform.tenants.show",
                "tags": [
                    "Tenant"
                ],
                "parameters": [
                    {
                        "name": "tenant",
                        "in": "path",
                        "required": true,
                        "description": "The tenant ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "patch": {
                "operationId": "v1.platform.tenants.update",
                "tags": [
                    "Tenant"
                ],
                "parameters": [
                    {
                        "name": "tenant",
                        "in": "path",
                        "required": true,
                        "description": "The tenant ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateTenantRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/platform\/tenants\/{tenant}\/activate": {
            "post": {
                "operationId": "v1.platform.tenants.activate",
                "tags": [
                    "Tenant"
                ],
                "parameters": [
                    {
                        "name": "tenant",
                        "in": "path",
                        "required": true,
                        "description": "The tenant ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/platform\/tenants\/{tenant}\/suspend": {
            "post": {
                "operationId": "v1.platform.tenants.suspend",
                "tags": [
                    "Tenant"
                ],
                "parameters": [
                    {
                        "name": "tenant",
                        "in": "path",
                        "required": true,
                        "description": "The tenant ID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`TenantResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/modules": {
            "get": {
                "operationId": "v1.core.modules.index",
                "tags": [
                    "TenantModule"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `TenantModuleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/TenantModuleResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/core\/modules\/{module}": {
            "patch": {
                "operationId": "v1.core.modules.update",
                "tags": [
                    "TenantModule"
                ],
                "parameters": [
                    {
                        "name": "module",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateTenantModuleRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`TenantModuleResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TenantModuleResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/auth\/tokens": {
            "get": {
                "operationId": "v1.core.auth.tokens.index",
                "tags": [
                    "Token"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `TokenResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/TokenResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.core.auth.tokens.store",
                "tags": [
                    "Token"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreTokenRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`TokenResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TokenResource"
                                        },
                                        "plain_text_token": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "plain_text_token"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/core\/auth\/tokens\/{token}": {
            "delete": {
                "operationId": "v1.core.auth.tokens.destroy",
                "tags": [
                    "Token"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AcceptInvitationRequest": {
                "type": "object",
                "description": "Same shape as consuming a magic link: a signed-out SPA user gets a session, a mobile app\nsends a device and gets a token, a signed-in user simply joins.",
                "properties": {
                    "token": {
                        "type": "string",
                        "minLength": 64,
                        "maxLength": 64
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "remember": {
                        "type": "boolean"
                    },
                    "device": {
                        "type": "object",
                        "properties": {
                            "installation_id": {
                                "type": "string",
                                "maxLength": 128
                            },
                            "platform": {
                                "$ref": "#\/components\/schemas\/DevicePlatform"
                            },
                            "name": {
                                "type": "string",
                                "maxLength": 100
                            },
                            "model": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "os_version": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "app_version": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "push_token": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 512
                            }
                        }
                    }
                },
                "required": [
                    "token"
                ],
                "title": "AcceptInvitationRequest"
            },
            "AssignRolesRequest": {
                "type": "object",
                "properties": {
                    "roles": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 64
                        },
                        "minItems": 1,
                        "uniqueItems": true
                    }
                },
                "required": [
                    "roles"
                ],
                "title": "AssignRolesRequest"
            },
            "AuditEventResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "occurred_at": {
                        "type": "string"
                    },
                    "action": {
                        "type": "string"
                    },
                    "actor": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "id": {
                                "type": "string"
                            },
                            "label": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "type",
                            "id",
                            "label"
                        ]
                    },
                    "resource": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "id": {
                                "type": "string"
                            },
                            "label": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "type",
                            "id",
                            "label"
                        ]
                    },
                    "changes": {
                        "type": "string"
                    },
                    "metadata": {
                        "type": "string"
                    },
                    "request_id": {
                        "type": "string"
                    },
                    "ip": {
                        "type": "string"
                    },
                    "target_tenant_id": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "occurred_at",
                    "action",
                    "actor",
                    "resource",
                    "changes",
                    "metadata",
                    "request_id",
                    "ip"
                ],
                "title": "AuditEventResource"
            },
            "ConsumeMagicLinkRequest": {
                "type": "object",
                "description": "From the first-party SPA (stateful request) the link starts a cookie session.\nFrom anything else it must describe the device that will hold the access token.",
                "properties": {
                    "token": {
                        "type": "string",
                        "minLength": 64,
                        "maxLength": 64
                    },
                    "remember": {
                        "type": "boolean"
                    },
                    "device": {
                        "type": "object",
                        "properties": {
                            "installation_id": {
                                "type": "string",
                                "maxLength": 128
                            },
                            "platform": {
                                "$ref": "#\/components\/schemas\/DevicePlatform"
                            },
                            "name": {
                                "type": "string",
                                "maxLength": 100
                            },
                            "model": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 100
                            },
                            "os_version": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "app_version": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 50
                            },
                            "push_token": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 512
                            }
                        }
                    }
                },
                "required": [
                    "token"
                ],
                "title": "ConsumeMagicLinkRequest"
            },
            "ContactAddressResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "line1": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "line2": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "region": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "postal_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_primary": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "line1",
                    "line2",
                    "city",
                    "region",
                    "postal_code",
                    "country",
                    "is_primary"
                ],
                "title": "ContactAddressResource"
            },
            "ContactIdentityResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "value": {
                        "type": "string"
                    },
                    "normalized": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "label": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_primary": {
                        "type": "boolean"
                    },
                    "verified_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "value",
                    "normalized",
                    "provider",
                    "label",
                    "is_primary",
                    "verified_at",
                    "created_at"
                ],
                "title": "ContactIdentityResource"
            },
            "ContactKind": {
                "type": "string",
                "enum": [
                    "person",
                    "organization"
                ],
                "title": "ContactKind"
            },
            "ContactResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "display_name": {
                        "type": "string"
                    },
                    "given_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "middle_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "family_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "salutation": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "gender": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "birth_date": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "nationality": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "organization_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "languages": {
                        "type": "array",
                        "items": {}
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "trade_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "registration_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "website": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "owner_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tags": {
                        "type": "array",
                        "items": {}
                    },
                    "custom_fields": {
                        "type": "string"
                    },
                    "metadata": {
                        "type": "string"
                    },
                    "do_not_contact": {
                        "type": "boolean"
                    },
                    "do_not_contact_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sms_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "consent_source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "verified_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "primary_email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "primary_phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "identities": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/ContactIdentityResource"
                        }
                    },
                    "addresses": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/ContactAddressResource"
                        }
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "deleted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "display_name",
                    "given_name",
                    "middle_name",
                    "family_name",
                    "salutation",
                    "gender",
                    "birth_date",
                    "nationality",
                    "job_title",
                    "organization_id",
                    "languages",
                    "name",
                    "trade_name",
                    "registration_number",
                    "vat_number",
                    "website",
                    "industry",
                    "owner_id",
                    "source",
                    "notes",
                    "tags",
                    "custom_fields",
                    "metadata",
                    "do_not_contact",
                    "do_not_contact_reason",
                    "email_marketing_consented_at",
                    "sms_marketing_consented_at",
                    "consent_source",
                    "verified_at",
                    "created_by",
                    "created_at",
                    "updated_at",
                    "deleted_at"
                ],
                "title": "ContactResource"
            },
            "ContactShareResource": {
                "type": "object",
                "properties": {
                    "user_id": {
                        "type": "string"
                    },
                    "can_edit": {
                        "type": "boolean"
                    },
                    "granted_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "user_id",
                    "can_edit",
                    "granted_by",
                    "created_at"
                ],
                "title": "ContactShareResource"
            },
            "ContactTagShareResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "tag": {
                        "type": "string"
                    },
                    "user_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "role_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "can_edit": {
                        "type": "boolean"
                    },
                    "granted_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "tag",
                    "user_id",
                    "role_id",
                    "can_edit",
                    "granted_by",
                    "created_at"
                ],
                "title": "ContactTagShareResource"
            },
            "DataExportResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "resources": {
                        "type": "array",
                        "items": {}
                    },
                    "size_bytes": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "requested_by": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "type",
                            "id"
                        ]
                    },
                    "expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "download_url": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "status",
                    "resources",
                    "size_bytes",
                    "error",
                    "requested_by",
                    "expires_at",
                    "completed_at",
                    "created_at"
                ],
                "title": "DataExportResource"
            },
            "DevicePlatform": {
                "type": "string",
                "enum": [
                    "ios",
                    "android",
                    "web"
                ],
                "title": "DevicePlatform"
            },
            "DeviceResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "platform": {
                        "$ref": "#\/components\/schemas\/DevicePlatform"
                    },
                    "name": {
                        "type": "string"
                    },
                    "model": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "os_version": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "app_version": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_push_token": {
                        "type": "boolean"
                    },
                    "last_seen_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "last_ip": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_current": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "platform",
                    "name",
                    "model",
                    "os_version",
                    "app_version",
                    "has_push_token",
                    "last_seen_at",
                    "last_ip",
                    "is_current",
                    "created_at"
                ],
                "title": "DeviceResource"
            },
            "Frontend": {
                "type": "string",
                "description": "A first-party SPA that links sent by email open. Base URLs live in config('core.frontends').\n",
                "enum": [
                    "app",
                    "operator"
                ],
                "title": "Frontend"
            },
            "IdentityKind": {
                "type": "string",
                "description": "What kind of identifier a contact identity is. Email, document and external identities are unique per tenant; phone numbers may be shared by several contacts.\n",
                "enum": [
                    "email",
                    "phone",
                    "document",
                    "external"
                ],
                "title": "IdentityKind"
            },
            "InvitationResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "roles": {
                        "type": "array",
                        "items": {}
                    },
                    "invited_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "accepted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "revoked_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "email",
                    "roles",
                    "invited_by",
                    "expires_at",
                    "accepted_at",
                    "revoked_at",
                    "created_at"
                ],
                "title": "InvitationResource"
            },
            "ListingResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "title",
                    "status",
                    "price_cents",
                    "currency",
                    "created_by",
                    "published_at",
                    "created_at"
                ],
                "title": "ListingResource"
            },
            "LookupRequest": {
                "type": "object",
                "properties": {
                    "kind": {
                        "$ref": "#\/components\/schemas\/IdentityKind"
                    },
                    "value": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    }
                },
                "required": [
                    "kind",
                    "value"
                ],
                "title": "LookupRequest"
            },
            "MembershipResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#\/components\/schemas\/MembershipStatus"
                    },
                    "user": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name",
                            "email"
                        ]
                    },
                    "roles": {
                        "type": "array",
                        "items": {}
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "status",
                    "created_at"
                ],
                "title": "MembershipResource"
            },
            "MembershipStatus": {
                "type": "string",
                "enum": [
                    "active",
                    "suspended"
                ],
                "title": "MembershipStatus"
            },
            "ModuleResource": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    },
                    "package": {
                        "type": "string"
                    },
                    "dependencies": {
                        "type": "string"
                    },
                    "permissions": {
                        "type": "string"
                    },
                    "default_limits": {
                        "type": "string"
                    },
                    "default_settings": {
                        "type": "string"
                    },
                    "settings_schema": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "additionalProperties": {}
                    },
                    "published_events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "key",
                    "name",
                    "version",
                    "package",
                    "dependencies",
                    "permissions",
                    "default_limits",
                    "default_settings",
                    "settings_schema",
                    "published_events"
                ],
                "title": "ModuleResource"
            },
            "MoveOrgMemberRequest": {
                "type": "object",
                "properties": {
                    "membership_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "from_unit_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "to_unit_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "role": {
                        "$ref": "#\/components\/schemas\/OrgUnitRole"
                    }
                },
                "required": [
                    "membership_id"
                ],
                "title": "MoveOrgMemberRequest"
            },
            "OperatorResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "roles": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/PlatformRoleResource"
                        }
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "created_at"
                ],
                "title": "OperatorResource"
            },
            "OrgUnitMemberResource": {
                "type": "object",
                "properties": {
                    "membership_id": {
                        "type": "string"
                    },
                    "unit_id": {
                        "type": "string"
                    },
                    "role": {
                        "$ref": "#\/components\/schemas\/OrgUnitRole"
                    },
                    "user": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "name",
                                    "email"
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id"
                                ]
                            }
                        ]
                    },
                    "since": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "membership_id",
                    "unit_id",
                    "role",
                    "since"
                ],
                "title": "OrgUnitMemberResource"
            },
            "OrgUnitResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "parent_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "kind": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "active": {
                        "type": "boolean"
                    },
                    "settings": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "members": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/OrgUnitMemberResource"
                        }
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "parent_id",
                    "kind",
                    "name",
                    "code",
                    "description",
                    "sort_order",
                    "active",
                    "settings",
                    "created_at",
                    "updated_at"
                ],
                "title": "OrgUnitResource"
            },
            "OrgUnitRole": {
                "type": "string",
                "description": "A membership's role on an organization unit. `lead` and `deputy` are singular seats; a deputy covers a vacant lead seat. Holding any role but `member` supervises the unit's members (and the members of every unit below it).\n",
                "enum": [
                    "lead",
                    "deputy",
                    "admin",
                    "member"
                ],
                "title": "OrgUnitRole"
            },
            "PermissionResource": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "scope": {
                        "$ref": "#\/components\/schemas\/PermissionScope"
                    },
                    "module_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "key",
                    "scope",
                    "module_key",
                    "description"
                ],
                "title": "PermissionResource"
            },
            "PermissionScope": {
                "type": "string",
                "enum": [
                    "platform",
                    "tenant"
                ],
                "title": "PermissionScope"
            },
            "PlatformRoleResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "key": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "managed": {
                        "type": "boolean"
                    },
                    "permissions": {
                        "type": "array",
                        "items": {}
                    }
                },
                "required": [
                    "id",
                    "key",
                    "name",
                    "description",
                    "managed"
                ],
                "title": "PlatformRoleResource"
            },
            "ReorderOrgUnitsRequest": {
                "type": "object",
                "properties": {
                    "parent_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "ids": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "minItems": 1,
                        "maxItems": 500,
                        "uniqueItems": true
                    }
                },
                "required": [
                    "ids"
                ],
                "title": "ReorderOrgUnitsRequest"
            },
            "RequestMagicLinkRequest": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "frontend": {
                        "$ref": "#\/components\/schemas\/Frontend"
                    }
                },
                "required": [
                    "email"
                ],
                "title": "RequestMagicLinkRequest"
            },
            "RoleResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "key": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "managed": {
                        "type": "boolean"
                    },
                    "permissions": {
                        "type": "array",
                        "items": {}
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "key",
                    "name",
                    "description",
                    "managed",
                    "created_at"
                ],
                "title": "RoleResource"
            },
            "ServiceAccountResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "$ref": "#\/components\/schemas\/ServiceAccountStatus"
                    },
                    "roles": {
                        "type": "array",
                        "items": {}
                    },
                    "created_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "description",
                    "status",
                    "created_by",
                    "created_at"
                ],
                "title": "ServiceAccountResource"
            },
            "ServiceAccountStatus": {
                "type": "string",
                "enum": [
                    "active",
                    "suspended"
                ],
                "title": "ServiceAccountStatus"
            },
            "SessionResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "ip_address": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "user_agent": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_active_at": {
                        "type": "string"
                    },
                    "is_current": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "ip_address",
                    "user_agent",
                    "last_active_at",
                    "is_current"
                ],
                "title": "SessionResource"
            },
            "SetEntitlementRequest": {
                "type": "object",
                "properties": {
                    "entitled": {
                        "type": "boolean"
                    },
                    "limits": {
                        "type": "array",
                        "items": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "minimum": 0
                        }
                    }
                },
                "required": [
                    "entitled"
                ],
                "title": "SetEntitlementRequest"
            },
            "SetOrgUnitMembersRequest": {
                "type": "object",
                "properties": {
                    "members": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "membership_id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "role": {
                                    "$ref": "#\/components\/schemas\/OrgUnitRole"
                                }
                            },
                            "required": [
                                "membership_id",
                                "role"
                            ]
                        },
                        "maxItems": 1000,
                        "uniqueItems": true
                    }
                },
                "required": [
                    "members"
                ],
                "title": "SetOrgUnitMembersRequest"
            },
            "ShareRequest": {
                "type": "object",
                "properties": {
                    "user_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "can_edit": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "user_id"
                ],
                "title": "ShareRequest"
            },
            "StoreContactRequest": {
                "type": "object",
                "properties": {
                    "kind": {
                        "$ref": "#\/components\/schemas\/ContactKind"
                    },
                    "given_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "middle_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "family_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "display_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "salutation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "gender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "male",
                            "female",
                            "other",
                            "unspecified",
                            null
                        ]
                    },
                    "birth_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "nationality": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z]{2}$"
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120
                    },
                    "organization_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "languages": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{2,3}$"
                        },
                        "maxItems": 20
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "trade_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32
                    },
                    "website": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri",
                        "maxLength": 255
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "maxItems": 50
                    },
                    "custom_fields": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "do_not_contact": {
                        "type": "boolean"
                    },
                    "do_not_contact_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "email_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sms_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "consent_source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "addresses": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "kind": {
                                    "type": "string",
                                    "enum": [
                                        "home",
                                        "work",
                                        "billing",
                                        "other"
                                    ]
                                },
                                "line1": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 200
                                },
                                "line2": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 200
                                },
                                "city": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 100
                                },
                                "region": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 100
                                },
                                "postal_code": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 20
                                },
                                "country": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^[A-Za-z]{2}$"
                                },
                                "is_primary": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "kind"
                            ]
                        },
                        "maxItems": 10
                    },
                    "owner_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "identities": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "kind": {
                                    "$ref": "#\/components\/schemas\/IdentityKind"
                                },
                                "value": {
                                    "type": "string",
                                    "maxLength": 255
                                },
                                "provider": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 64
                                },
                                "label": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "enum": [
                                        "home",
                                        "work",
                                        "mobile",
                                        "other",
                                        null
                                    ]
                                },
                                "primary": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "kind",
                                "value"
                            ]
                        },
                        "maxItems": 20
                    },
                    "allow_duplicate": {
                        "type": "boolean"
                    }
                },
                "title": "StoreContactRequest"
            },
            "StoreIdentityRequest": {
                "type": "object",
                "properties": {
                    "kind": {
                        "$ref": "#\/components\/schemas\/IdentityKind"
                    },
                    "value": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "home",
                            "work",
                            "mobile",
                            "other",
                            null
                        ]
                    },
                    "primary": {
                        "type": "boolean"
                    },
                    "allow_duplicate": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "kind",
                    "value"
                ],
                "title": "StoreIdentityRequest"
            },
            "StoreInvitationRequest": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "roles": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 64
                        },
                        "minItems": 1,
                        "uniqueItems": true
                    }
                },
                "required": [
                    "email",
                    "roles"
                ],
                "title": "StoreInvitationRequest"
            },
            "StoreListingRequest": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 200
                    },
                    "price_cents": {
                        "type": "integer",
                        "minimum": 0
                    }
                },
                "required": [
                    "title"
                ],
                "title": "StoreListingRequest"
            },
            "StoreOperatorRequest": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "role": {
                        "type": "string"
                    }
                },
                "required": [
                    "email",
                    "role"
                ],
                "title": "StoreOperatorRequest"
            },
            "StoreOrgUnitRequest": {
                "type": "object",
                "properties": {
                    "kind": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]*$",
                        "maxLength": 32
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*$",
                        "maxLength": 32
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "parent_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "sort_order": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100000
                    },
                    "active": {
                        "type": "boolean"
                    },
                    "settings": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "kind",
                    "name"
                ],
                "title": "StoreOrgUnitRequest"
            },
            "StoreRoleRequest": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_-]*$",
                        "minLength": 2,
                        "maxLength": 64
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "permissions": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "uniqueItems": true
                    }
                },
                "required": [
                    "key",
                    "name",
                    "permissions"
                ],
                "title": "StoreRoleRequest"
            },
            "StoreServiceAccountRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "roles": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 64
                        },
                        "uniqueItems": true
                    }
                },
                "required": [
                    "name",
                    "roles"
                ],
                "title": "StoreServiceAccountRequest"
            },
            "StoreServiceAccountTokenRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^(\\*|[a-z0-9_]+(\\.[a-z0-9_]+)+)$"
                        },
                        "minItems": 1,
                        "uniqueItems": true
                    },
                    "expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "name",
                    "scopes"
                ],
                "title": "StoreServiceAccountTokenRequest"
            },
            "StoreTenantRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "slug": {
                        "type": "string",
                        "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$",
                        "minLength": 3,
                        "maxLength": 63
                    },
                    "owner_email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "active"
                        ]
                    }
                },
                "required": [
                    "name",
                    "slug",
                    "owner_email"
                ],
                "title": "StoreTenantRequest"
            },
            "StoreTokenRequest": {
                "type": "object",
                "description": "Integration tokens act within exactly one tenant the user is an active member of, and may\nonly carry scopes the user currently holds there (or \"*\", meaning all of them).",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "tenant": {
                        "type": "string",
                        "maxLength": 63
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^(\\*|[a-z0-9_]+(\\.[a-z0-9_]+)+)$"
                        },
                        "minItems": 1,
                        "uniqueItems": true
                    },
                    "expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "name",
                    "tenant",
                    "scopes"
                ],
                "title": "StoreTokenRequest"
            },
            "TagShareRequest": {
                "type": "object",
                "properties": {
                    "user_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "role_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "can_edit": {
                        "type": "boolean"
                    }
                },
                "title": "TagShareRequest"
            },
            "TenantModuleResource": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    },
                    "entitled": {
                        "type": "boolean"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "usable": {
                        "type": "boolean"
                    },
                    "unsatisfied_dependencies": {
                        "type": "array",
                        "items": {}
                    },
                    "limits": {
                        "type": "string"
                    },
                    "settings": {
                        "type": "string"
                    }
                },
                "required": [
                    "key",
                    "name",
                    "version",
                    "entitled",
                    "enabled",
                    "usable",
                    "unsatisfied_dependencies",
                    "limits",
                    "settings"
                ],
                "title": "TenantModuleResource"
            },
            "TenantResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#\/components\/schemas\/TenantStatus"
                    },
                    "audit_retention_months": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "slug",
                    "name",
                    "status",
                    "audit_retention_months",
                    "created_at"
                ],
                "title": "TenantResource"
            },
            "TenantStatus": {
                "type": "string",
                "enum": [
                    "pending",
                    "active",
                    "suspended"
                ],
                "title": "TenantStatus"
            },
            "TokenResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "tenant_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "scopes": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "last_used_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "tenant_id",
                    "scopes",
                    "last_used_at",
                    "expires_at",
                    "created_at"
                ],
                "title": "TokenResource"
            },
            "UpdateContactRequest": {
                "type": "object",
                "description": "Partial update. Owner changes go through PUT {contact}\/owner and identities through their\nown endpoints, so neither is accepted here.",
                "properties": {
                    "kind": {
                        "$ref": "#\/components\/schemas\/ContactKind"
                    },
                    "given_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "middle_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "family_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "display_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "salutation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "gender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "male",
                            "female",
                            "other",
                            "unspecified",
                            null
                        ]
                    },
                    "birth_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "nationality": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z]{2}$"
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120
                    },
                    "organization_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "languages": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{2,3}$"
                        },
                        "maxItems": 20
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "trade_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32
                    },
                    "website": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri",
                        "maxLength": 255
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "maxItems": 50
                    },
                    "custom_fields": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "do_not_contact": {
                        "type": "boolean"
                    },
                    "do_not_contact_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "email_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sms_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "consent_source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "addresses": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "kind": {
                                    "type": "string",
                                    "enum": [
                                        "home",
                                        "work",
                                        "billing",
                                        "other"
                                    ]
                                },
                                "line1": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 200
                                },
                                "line2": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 200
                                },
                                "city": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 100
                                },
                                "region": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 100
                                },
                                "postal_code": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 20
                                },
                                "country": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^[A-Za-z]{2}$"
                                },
                                "is_primary": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "kind"
                            ]
                        },
                        "maxItems": 10
                    }
                },
                "title": "UpdateContactRequest"
            },
            "UpdateDeviceRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "push_token": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 512
                    },
                    "app_version": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "os_version": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    }
                },
                "title": "UpdateDeviceRequest"
            },
            "UpdateIdentityRequest": {
                "type": "object",
                "properties": {
                    "label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "home",
                            "work",
                            "mobile",
                            "other",
                            null
                        ]
                    },
                    "primary": {
                        "type": "boolean"
                    },
                    "verified": {
                        "type": "boolean"
                    }
                },
                "title": "UpdateIdentityRequest"
            },
            "UpdateOrgUnitRequest": {
                "type": "object",
                "properties": {
                    "kind": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]*$",
                        "maxLength": 32
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*$",
                        "maxLength": 32
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "parent_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "sort_order": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100000
                    },
                    "active": {
                        "type": "boolean"
                    },
                    "settings": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "title": "UpdateOrgUnitRequest"
            },
            "UpdateRoleRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "permissions": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "uniqueItems": true
                    }
                },
                "title": "UpdateRoleRequest"
            },
            "UpdateServiceAccountRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "status": {
                        "$ref": "#\/components\/schemas\/ServiceAccountStatus"
                    }
                },
                "title": "UpdateServiceAccountRequest"
            },
            "UpdateTenantModuleRequest": {
                "type": "object",
                "properties": {
                    "enabled": {
                        "type": "boolean"
                    },
                    "settings": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "title": "UpdateTenantModuleRequest"
            },
            "UpdateTenantRequest": {
                "type": "object",
                "description": "Operators may rename a tenant and set its audit retention; the slug is immutable.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "audit_retention_months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 120
                    }
                },
                "title": "UpdateTenantRequest"
            },
            "UpsertContactRequest": {
                "type": "object",
                "properties": {
                    "kind": {
                        "$ref": "#\/components\/schemas\/ContactKind"
                    },
                    "given_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "middle_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "family_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "display_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "salutation": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "gender": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "male",
                            "female",
                            "other",
                            "unspecified",
                            null
                        ]
                    },
                    "birth_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "nationality": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z]{2}$"
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120
                    },
                    "organization_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "languages": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{2,3}$"
                        },
                        "maxItems": 20
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "trade_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32
                    },
                    "website": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri",
                        "maxLength": 255
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "maxItems": 50
                    },
                    "custom_fields": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "do_not_contact": {
                        "type": "boolean"
                    },
                    "do_not_contact_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "email_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sms_marketing_consented_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "consent_source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "addresses": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "kind": {
                                    "type": "string",
                                    "enum": [
                                        "home",
                                        "work",
                                        "billing",
                                        "other"
                                    ]
                                },
                                "line1": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 200
                                },
                                "line2": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 200
                                },
                                "city": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 100
                                },
                                "region": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 100
                                },
                                "postal_code": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 20
                                },
                                "country": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^[A-Za-z]{2}$"
                                },
                                "is_primary": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "kind"
                            ]
                        },
                        "maxItems": 10
                    },
                    "owner_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uuid"
                    },
                    "identities": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "kind": {
                                    "$ref": "#\/components\/schemas\/IdentityKind"
                                },
                                "value": {
                                    "type": "string",
                                    "maxLength": 255
                                },
                                "provider": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 64
                                },
                                "label": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "enum": [
                                        "home",
                                        "work",
                                        "mobile",
                                        "other",
                                        null
                                    ]
                                },
                                "primary": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "kind",
                                "value"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 20
                    }
                },
                "required": [
                    "identities"
                ],
                "title": "UpsertContactRequest"
            },
            "UserResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "email_verified_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "platform_permissions": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "email_verified_at",
                    "created_at"
                ],
                "title": "UserResource"
            }
        },
        "responses": {
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "AuthorizationException": {
                "description": "Authorization error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}