{
    "openapi": "3.1.0",
    "info": {
        "title": "Harmoniq API",
        "version": "1.0",
        "description": "The Harmoniq company API. Every request is made to your company’s own address, with a key created in Harmoniq (Access → API keys)."
    },
    "servers": [
        {
            "url": "https://{company}.harmoniq.ro/api/v1",
            "variables": {
                "company": {
                    "default": "compania-mea",
                    "description": "Your company’s address in Harmoniq (the part before .harmoniq.ro)."
                }
            }
        }
    ],
    "security": [
        {
            "bearer": []
        }
    ],
    "paths": {
        "/geo-areas": {
            "get": {
                "tags": [
                    "Geographic areas"
                ],
                "summary": "List: Geographic areas",
                "security": [
                    {
                        "bearer": [
                            "geo_areas:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "parent_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only the areas directly under this one."
                    },
                    {
                        "name": "roots",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: only the top-level areas."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/GeoAreas"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Geographic areas"
                ],
                "summary": "Create: Geographic areas",
                "security": [
                    {
                        "bearer": [
                            "geo_areas:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GeoAreasInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GeoAreas"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/geo-areas/{id}": {
            "get": {
                "tags": [
                    "Geographic areas"
                ],
                "summary": "One record: Geographic areas",
                "security": [
                    {
                        "bearer": [
                            "geo_areas:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GeoAreas"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Geographic areas"
                ],
                "summary": "Change: Geographic areas",
                "security": [
                    {
                        "bearer": [
                            "geo_areas:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GeoAreasInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GeoAreas"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Geographic areas"
                ],
                "summary": "Delete: Geographic areas",
                "security": [
                    {
                        "bearer": [
                            "geo_areas:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/work-units": {
            "get": {
                "tags": [
                    "Work units"
                ],
                "summary": "List: Work units",
                "security": [
                    {
                        "bearer": [
                            "work_units:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "CJ01"
                        },
                        "description": "Exact code (case-insensitive)."
                    },
                    {
                        "name": "geo_area_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only in this area."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WorkUnits"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Work units"
                ],
                "summary": "Create: Work units",
                "security": [
                    {
                        "bearer": [
                            "work_units:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WorkUnitsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WorkUnits"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/work-units/{id}": {
            "get": {
                "tags": [
                    "Work units"
                ],
                "summary": "One record: Work units",
                "security": [
                    {
                        "bearer": [
                            "work_units:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WorkUnits"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Work units"
                ],
                "summary": "Change: Work units",
                "security": [
                    {
                        "bearer": [
                            "work_units:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WorkUnitsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WorkUnits"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Work units"
                ],
                "summary": "Delete: Work units",
                "security": [
                    {
                        "bearer": [
                            "work_units:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/departments": {
            "get": {
                "tags": [
                    "Departments"
                ],
                "summary": "List: Departments",
                "security": [
                    {
                        "bearer": [
                            "departments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "FARM"
                        },
                        "description": "Exact code (case-insensitive)."
                    },
                    {
                        "name": "parent_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only the departments directly under this one."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Departments"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Departments"
                ],
                "summary": "Create: Departments",
                "security": [
                    {
                        "bearer": [
                            "departments:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DepartmentsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Departments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/departments/{id}": {
            "get": {
                "tags": [
                    "Departments"
                ],
                "summary": "One record: Departments",
                "security": [
                    {
                        "bearer": [
                            "departments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Departments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Departments"
                ],
                "summary": "Change: Departments",
                "security": [
                    {
                        "bearer": [
                            "departments:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DepartmentsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Departments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Departments"
                ],
                "summary": "Delete: Departments",
                "security": [
                    {
                        "bearer": [
                            "departments:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/positions": {
            "get": {
                "tags": [
                    "Positions"
                ],
                "summary": "List: Positions",
                "security": [
                    {
                        "bearer": [
                            "positions:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "FA"
                        },
                        "description": "Exact code (case-insensitive)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Positions"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Positions"
                ],
                "summary": "Create: Positions",
                "security": [
                    {
                        "bearer": [
                            "positions:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PositionsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Positions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/positions/{id}": {
            "get": {
                "tags": [
                    "Positions"
                ],
                "summary": "One record: Positions",
                "security": [
                    {
                        "bearer": [
                            "positions:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Positions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Positions"
                ],
                "summary": "Change: Positions",
                "security": [
                    {
                        "bearer": [
                            "positions:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PositionsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Positions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Positions"
                ],
                "summary": "Delete: Positions",
                "security": [
                    {
                        "bearer": [
                            "positions:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/teams": {
            "get": {
                "tags": [
                    "Teams"
                ],
                "summary": "List: Teams",
                "security": [
                    {
                        "bearer": [
                            "teams:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only the teams this employee is in."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Teams"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Teams"
                ],
                "summary": "Create: Teams",
                "security": [
                    {
                        "bearer": [
                            "teams:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TeamsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Teams"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/teams/{id}": {
            "get": {
                "tags": [
                    "Teams"
                ],
                "summary": "One record: Teams",
                "security": [
                    {
                        "bearer": [
                            "teams:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Teams"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Teams"
                ],
                "summary": "Change: Teams",
                "security": [
                    {
                        "bearer": [
                            "teams:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TeamsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Teams"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Teams"
                ],
                "summary": "Delete: Teams",
                "security": [
                    {
                        "bearer": [
                            "teams:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/teams/{id}/add-member": {
            "post": {
                "tags": [
                    "Teams"
                ],
                "summary": "Adds an employee to the team (nothing changes if they are already in it). Body: {\"employee_id\": 345}.",
                "security": [
                    {
                        "bearer": [
                            "teams:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "employee_id": {
                                        "type": "integer",
                                        "example": 345,
                                        "description": "The employee to add (an id from /employees)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Teams"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/teams/{id}/remove-member": {
            "post": {
                "tags": [
                    "Teams"
                ],
                "summary": "Removes an employee from the team. Body: {\"employee_id\": 345}.",
                "security": [
                    {
                        "bearer": [
                            "teams:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "employee_id": {
                                        "type": "integer",
                                        "example": 345,
                                        "description": "The employee to remove (an id from /employees)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Teams"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/custom-fields": {
            "get": {
                "tags": [
                    "Custom fields"
                ],
                "summary": "List: Custom fields",
                "security": [
                    {
                        "bearer": [
                            "custom_fields:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "entity",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "employee",
                                "work_unit",
                                "department",
                                "position",
                                "team",
                                "company"
                            ],
                            "example": "employee"
                        },
                        "description": "Only the fields of this kind of record."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CustomFields"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/custom-fields/{id}": {
            "get": {
                "tags": [
                    "Custom fields"
                ],
                "summary": "One record: Custom fields",
                "security": [
                    {
                        "bearer": [
                            "custom_fields:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CustomFields"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/employees": {
            "get": {
                "tags": [
                    "Employees"
                ],
                "summary": "List: Employees",
                "security": [
                    {
                        "bearer": [
                            "employees:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "inactive",
                                "terminated"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Currently placed in this unit."
                    },
                    {
                        "name": "employee_number",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Exact employee number."
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Exact email."
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "popescu"
                        },
                        "description": "Part of the name."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Employees"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Employees"
                ],
                "summary": "Create: Employees",
                "security": [
                    {
                        "bearer": [
                            "employees:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/EmployeesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Employees"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/employees/{id}": {
            "get": {
                "tags": [
                    "Employees"
                ],
                "summary": "One record: Employees",
                "security": [
                    {
                        "bearer": [
                            "employees:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Employees"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Employees"
                ],
                "summary": "Change: Employees",
                "security": [
                    {
                        "bearer": [
                            "employees:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/EmployeesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Employees"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Employees"
                ],
                "summary": "Delete: Employees",
                "security": [
                    {
                        "bearer": [
                            "employees:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/placements": {
            "get": {
                "tags": [
                    "Placements"
                ],
                "summary": "List: Placements",
                "security": [
                    {
                        "bearer": [
                            "placements:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person’s."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only in this unit."
                    },
                    {
                        "name": "current",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: only placements in force today."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Placements"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Placements"
                ],
                "summary": "Create: Placements",
                "security": [
                    {
                        "bearer": [
                            "placements:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PlacementsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Placements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/placements/{id}": {
            "get": {
                "tags": [
                    "Placements"
                ],
                "summary": "One record: Placements",
                "security": [
                    {
                        "bearer": [
                            "placements:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Placements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Placements"
                ],
                "summary": "Delete: Placements",
                "security": [
                    {
                        "bearer": [
                            "placements:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/placements/{id}/end": {
            "post": {
                "tags": [
                    "Placements"
                ],
                "summary": "Ends the placement on valid_to (not before it began).",
                "security": [
                    {
                        "bearer": [
                            "placements:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "valid_to": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-06-30",
                                        "description": "The last day of the placement (Y-m-d)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Placements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/placements/{id}/make-primary": {
            "post": {
                "tags": [
                    "Placements"
                ],
                "summary": "Makes it the person’s main placement; the previous main one becomes secondary.",
                "security": [
                    {
                        "bearer": [
                            "placements:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Placements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-types": {
            "get": {
                "tags": [
                    "Leave types"
                ],
                "summary": "List: Leave types",
                "security": [
                    {
                        "bearer": [
                            "leave_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/LeaveTypes"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/leave-types/{id}": {
            "get": {
                "tags": [
                    "Leave types"
                ],
                "summary": "One record: Leave types",
                "security": [
                    {
                        "bearer": [
                            "leave_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-requests": {
            "get": {
                "tags": [
                    "Leave requests"
                ],
                "summary": "List: Leave requests",
                "security": [
                    {
                        "bearer": [
                            "leave_requests:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person’s."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "approved",
                                "rejected",
                                "cancelled"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-01"
                        },
                        "description": "Touching this day or later."
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-31"
                        },
                        "description": "Touching this day or earlier."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/LeaveRequests"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Leave requests"
                ],
                "summary": "Create: Leave requests",
                "security": [
                    {
                        "bearer": [
                            "leave_requests:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LeaveRequestsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-requests/{id}": {
            "get": {
                "tags": [
                    "Leave requests"
                ],
                "summary": "One record: Leave requests",
                "security": [
                    {
                        "bearer": [
                            "leave_requests:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-requests/{id}/approve": {
            "post": {
                "tags": [
                    "Leave requests"
                ],
                "summary": "Approves the current step (comment optional).",
                "security": [
                    {
                        "bearer": [
                            "leave_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000,
                                        "description": "Optional comment for the person."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-requests/{id}/reject": {
            "post": {
                "tags": [
                    "Leave requests"
                ],
                "summary": "Rejects the request; comment (the reason) required.",
                "security": [
                    {
                        "bearer": [
                            "leave_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "comment": {
                                        "type": "string",
                                        "maxLength": 1000,
                                        "description": "The reason, shown to the person (required)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-requests/{id}/cancel": {
            "post": {
                "tags": [
                    "Leave requests"
                ],
                "summary": "Cancels a pending or approved request.",
                "security": [
                    {
                        "bearer": [
                            "leave_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leave-balances": {
            "get": {
                "tags": [
                    "Leave balances"
                ],
                "summary": "List: Leave balances",
                "security": [
                    {
                        "bearer": [
                            "leave_balances:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "example": 2026
                        },
                        "description": "The year (default: this year)."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person."
                    },
                    {
                        "name": "leave_type_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this leave type."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/LeaveBalances"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/leave-balances/{id}": {
            "get": {
                "tags": [
                    "Leave balances"
                ],
                "summary": "One record: Leave balances",
                "security": [
                    {
                        "bearer": [
                            "leave_balances:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveBalances"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Leave balances"
                ],
                "summary": "Change: Leave balances",
                "security": [
                    {
                        "bearer": [
                            "leave_balances:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LeaveBalancesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LeaveBalances"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/calendar-events": {
            "get": {
                "tags": [
                    "Calendar events"
                ],
                "summary": "List: Calendar events",
                "security": [
                    {
                        "bearer": [
                            "calendar_events:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-01"
                        },
                        "description": "Ending on this day or later."
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-31"
                        },
                        "description": "Starting on this day or earlier."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s."
                    },
                    {
                        "name": "cancelled",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: only cancelled ones; false: only the rest."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CalendarEvents"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Calendar events"
                ],
                "summary": "Create: Calendar events",
                "security": [
                    {
                        "bearer": [
                            "calendar_events:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CalendarEventsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CalendarEvents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/calendar-events/{id}": {
            "get": {
                "tags": [
                    "Calendar events"
                ],
                "summary": "One record: Calendar events",
                "security": [
                    {
                        "bearer": [
                            "calendar_events:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CalendarEvents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Calendar events"
                ],
                "summary": "Change: Calendar events",
                "security": [
                    {
                        "bearer": [
                            "calendar_events:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CalendarEventsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CalendarEvents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Calendar events"
                ],
                "summary": "Delete: Calendar events",
                "security": [
                    {
                        "bearer": [
                            "calendar_events:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/calendar-events/{id}/cancel": {
            "post": {
                "tags": [
                    "Calendar events"
                ],
                "summary": "Cancels this occurrence; participants are told.",
                "security": [
                    {
                        "bearer": [
                            "calendar_events:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CalendarEvents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/kpi-metrics": {
            "get": {
                "tags": [
                    "KPI metrics"
                ],
                "summary": "List: KPI metrics",
                "security": [
                    {
                        "bearer": [
                            "kpi_metrics:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "sales.actual"
                        },
                        "description": "Exact key (case-insensitive)."
                    },
                    {
                        "name": "source_type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "manual",
                                "import",
                                "module",
                                "derived",
                                "api",
                                "objective",
                                "review"
                            ]
                        },
                        "description": "Only metrics with this source."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/KpiMetrics"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/kpi-metrics/{id}": {
            "get": {
                "tags": [
                    "KPI metrics"
                ],
                "summary": "One record: KPI metrics",
                "security": [
                    {
                        "bearer": [
                            "kpi_metrics:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/KpiMetrics"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/metric-values": {
            "get": {
                "tags": [
                    "KPI values"
                ],
                "summary": "List: KPI values",
                "security": [
                    {
                        "bearer": [
                            "metric_values:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "metric",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "sales.actual"
                        },
                        "description": "Only this metric’s values (its key)."
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "2026-09"
                        },
                        "description": "Only this period (needs metric)."
                    },
                    {
                        "name": "subject_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this subject."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MetricValues"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "KPI values"
                ],
                "summary": "Create: KPI values",
                "security": [
                    {
                        "bearer": [
                            "metric_values:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MetricValuesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MetricValues"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/metric-values/{id}": {
            "get": {
                "tags": [
                    "KPI values"
                ],
                "summary": "One record: KPI values",
                "security": [
                    {
                        "bearer": [
                            "metric_values:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MetricValues"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/kpi-scorecards": {
            "get": {
                "tags": [
                    "Scorecards"
                ],
                "summary": "List: Scorecards",
                "security": [
                    {
                        "bearer": [
                            "kpi_scorecards:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "published",
                                "archived"
                            ]
                        },
                        "description": "Only versions with this status."
                    },
                    {
                        "name": "family",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Only the versions of this scorecard."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/KpiScorecards"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/kpi-scorecards/{id}": {
            "get": {
                "tags": [
                    "Scorecards"
                ],
                "summary": "One record: Scorecards",
                "security": [
                    {
                        "bearer": [
                            "kpi_scorecards:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/KpiScorecards"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/kpi-results": {
            "get": {
                "tags": [
                    "KPI results"
                ],
                "summary": "List: KPI results",
                "security": [
                    {
                        "bearer": [
                            "kpi_results:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "scorecard_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this scorecard version."
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-09-01"
                        },
                        "description": "First day of the period (Y-m-d)."
                    },
                    {
                        "name": "subject_type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "employee",
                                "team",
                                "department",
                                "work_unit",
                                "geo_area",
                                "company"
                            ]
                        },
                        "description": "Only this kind of subject."
                    },
                    {
                        "name": "subject_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this subject."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/KpiResults"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/kpi-results/{id}": {
            "get": {
                "tags": [
                    "KPI results"
                ],
                "summary": "One record: KPI results",
                "security": [
                    {
                        "bearer": [
                            "kpi_results:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/KpiResults"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/objectives": {
            "get": {
                "tags": [
                    "Objectives"
                ],
                "summary": "List: Objectives",
                "security": [
                    {
                        "bearer": [
                            "objectives:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "rule_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only under this rule."
                    },
                    {
                        "name": "period_start",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-09-01"
                        },
                        "description": "First day of the period (Y-m-d)."
                    },
                    {
                        "name": "external_ref",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Your exact reference."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Objectives"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Objectives"
                ],
                "summary": "Create: Objectives",
                "security": [
                    {
                        "bearer": [
                            "objectives:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ObjectivesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Objectives"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/objectives/{id}": {
            "get": {
                "tags": [
                    "Objectives"
                ],
                "summary": "One record: Objectives",
                "security": [
                    {
                        "bearer": [
                            "objectives:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Objectives"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Objectives"
                ],
                "summary": "Change: Objectives",
                "security": [
                    {
                        "bearer": [
                            "objectives:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ObjectivesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Objectives"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Objectives"
                ],
                "summary": "Delete: Objectives",
                "security": [
                    {
                        "bearer": [
                            "objectives:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/objectives/{id}/record": {
            "post": {
                "tags": [
                    "Objectives"
                ],
                "summary": "Record what subjects achieved: their measures replace what was recorded before; empty measures forget it (no data again).",
                "security": [
                    {
                        "bearer": [
                            "objectives:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "achievements": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "example": [
                                            {
                                                "subject_id": 345,
                                                "measures": {
                                                    "pieces": "34"
                                                }
                                            }
                                        ],
                                        "description": "A list of {subject_id, measures: {measure name: number}}; subjects at the rule’s grain, in the target units."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Objectives"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/reviews": {
            "get": {
                "tags": [
                    "Evaluations"
                ],
                "summary": "List: Evaluations",
                "security": [
                    {
                        "bearer": [
                            "reviews:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "submitted",
                                "cancelled"
                            ]
                        },
                        "description": "submitted or cancelled."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person."
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this grid version."
                    },
                    {
                        "name": "period_start",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-09-01"
                        },
                        "description": "First day of the period (Y-m-d)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Reviews"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/reviews/{id}": {
            "get": {
                "tags": [
                    "Evaluations"
                ],
                "summary": "One record: Evaluations",
                "security": [
                    {
                        "bearer": [
                            "reviews:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Reviews"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/courses": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "List: Courses",
                "security": [
                    {
                        "bearer": [
                            "courses:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "published",
                                "archived"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only in this category."
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "incendiu"
                        },
                        "description": "Part of the title."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Courses"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Courses"
                ],
                "summary": "Create: Courses",
                "security": [
                    {
                        "bearer": [
                            "courses:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CoursesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Courses"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/courses/{id}": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "One record: Courses",
                "security": [
                    {
                        "bearer": [
                            "courses:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Courses"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Courses"
                ],
                "summary": "Change: Courses",
                "security": [
                    {
                        "bearer": [
                            "courses:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CoursesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Courses"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Courses"
                ],
                "summary": "Delete: Courses",
                "security": [
                    {
                        "bearer": [
                            "courses:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/learning-assignments": {
            "get": {
                "tags": [
                    "Learning assignments"
                ],
                "summary": "List: Learning assignments",
                "security": [
                    {
                        "bearer": [
                            "learning_assignments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only for this course."
                    },
                    {
                        "name": "test_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only for this test."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/LearningAssignments"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Learning assignments"
                ],
                "summary": "Create: Learning assignments",
                "security": [
                    {
                        "bearer": [
                            "learning_assignments:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LearningAssignmentsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LearningAssignments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/learning-assignments/{id}": {
            "get": {
                "tags": [
                    "Learning assignments"
                ],
                "summary": "One record: Learning assignments",
                "security": [
                    {
                        "bearer": [
                            "learning_assignments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/LearningAssignments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Learning assignments"
                ],
                "summary": "Delete: Learning assignments",
                "security": [
                    {
                        "bearer": [
                            "learning_assignments:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/enrollments": {
            "get": {
                "tags": [
                    "Enrolments"
                ],
                "summary": "List: Enrolments",
                "security": [
                    {
                        "bearer": [
                            "enrollments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person."
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this course."
                    },
                    {
                        "name": "test_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this test."
                    },
                    {
                        "name": "assignment_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this assignment."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assigned",
                                "in_progress",
                                "awaiting_grading",
                                "completed",
                                "failed",
                                "excused"
                            ]
                        },
                        "description": "Only with this status."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Enrollments"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/enrollments/{id}": {
            "get": {
                "tags": [
                    "Enrolments"
                ],
                "summary": "One record: Enrolments",
                "security": [
                    {
                        "bearer": [
                            "enrollments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Enrollments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/enrollments/{id}/extend": {
            "post": {
                "tags": [
                    "Enrolments"
                ],
                "summary": "Set a later due date.",
                "security": [
                    {
                        "bearer": [
                            "enrollments:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "due_on": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-06-30",
                                        "description": "The new due date, not before the enrolment opens."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Enrollments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/enrollments/{id}/grant-attempt": {
            "post": {
                "tags": [
                    "Enrolments"
                ],
                "summary": "Allow one more test attempt (not once passed).",
                "security": [
                    {
                        "bearer": [
                            "enrollments:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Enrollments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/enrollments/{id}/excuse": {
            "post": {
                "tags": [
                    "Enrolments"
                ],
                "summary": "Excuse the person (only before they start).",
                "security": [
                    {
                        "bearer": [
                            "enrollments:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Enrollments"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/certificates": {
            "get": {
                "tags": [
                    "Certificates"
                ],
                "summary": "List: Certificates",
                "security": [
                    {
                        "bearer": [
                            "certificates:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person."
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this course."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Certificates"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/certificates/{id}": {
            "get": {
                "tags": [
                    "Certificates"
                ],
                "summary": "One record: Certificates",
                "security": [
                    {
                        "bearer": [
                            "certificates:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Certificates"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audits": {
            "get": {
                "tags": [
                    "Audits"
                ],
                "summary": "List: Audits",
                "security": [
                    {
                        "bearer": [
                            "audits:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "completed"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "conducted_from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Conducted on or after this date."
                    },
                    {
                        "name": "conducted_to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Conducted on or before this date."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Audits"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/audits/{id}": {
            "get": {
                "tags": [
                    "Audits"
                ],
                "summary": "One record: Audits",
                "security": [
                    {
                        "bearer": [
                            "audits:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Audits"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audit-action-plans": {
            "get": {
                "tags": [
                    "Audit action plans"
                ],
                "summary": "List: Audit action plans",
                "security": [
                    {
                        "bearer": [
                            "audit_action_plans:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "audit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only for this audit."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "done",
                                "verified",
                                "cancelled"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "responsible_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only for this person."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AuditActionPlans"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/audit-action-plans/{id}": {
            "get": {
                "tags": [
                    "Audit action plans"
                ],
                "summary": "One record: Audit action plans",
                "security": [
                    {
                        "bearer": [
                            "audit_action_plans:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/AuditActionPlans"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audit-action-plans/{id}/mark-done": {
            "post": {
                "tags": [
                    "Audit action plans"
                ],
                "summary": "Mark an open action done.",
                "security": [
                    {
                        "bearer": [
                            "audit_action_plans:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000,
                                        "description": "What was done."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/AuditActionPlans"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audit-action-plans/{id}/verify": {
            "post": {
                "tags": [
                    "Audit action plans"
                ],
                "summary": "Accept a done action.",
                "security": [
                    {
                        "bearer": [
                            "audit_action_plans:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/AuditActionPlans"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audit-action-plans/{id}/reopen": {
            "post": {
                "tags": [
                    "Audit action plans"
                ],
                "summary": "Send a done action back, with the reason.",
                "security": [
                    {
                        "bearer": [
                            "audit_action_plans:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "description": "Why it is not accepted."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/AuditActionPlans"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audit-action-plans/{id}/cancel": {
            "post": {
                "tags": [
                    "Audit action plans"
                ],
                "summary": "Cancel an open or done action.",
                "security": [
                    {
                        "bearer": [
                            "audit_action_plans:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/AuditActionPlans"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ssm-types": {
            "get": {
                "tags": [
                    "Health & safety types"
                ],
                "summary": "List: Health & safety types",
                "security": [
                    {
                        "bearer": [
                            "ssm_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SsmTypes"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/ssm-types/{id}": {
            "get": {
                "tags": [
                    "Health & safety types"
                ],
                "summary": "One record: Health & safety types",
                "security": [
                    {
                        "bearer": [
                            "ssm_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SsmTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ssm-records": {
            "get": {
                "tags": [
                    "Health & safety records"
                ],
                "summary": "List: Health & safety records",
                "security": [
                    {
                        "bearer": [
                            "ssm_records:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person."
                    },
                    {
                        "name": "type_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this type."
                    },
                    {
                        "name": "valid_until_before",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-12-31"
                        },
                        "description": "Valid until this date or earlier."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SsmRecords"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Health & safety records"
                ],
                "summary": "Create: Health & safety records",
                "security": [
                    {
                        "bearer": [
                            "ssm_records:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SsmRecordsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SsmRecords"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ssm-records/{id}": {
            "get": {
                "tags": [
                    "Health & safety records"
                ],
                "summary": "One record: Health & safety records",
                "security": [
                    {
                        "bearer": [
                            "ssm_records:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SsmRecords"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Health & safety records"
                ],
                "summary": "Delete: Health & safety records",
                "security": [
                    {
                        "bearer": [
                            "ssm_records:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/document-categories": {
            "get": {
                "tags": [
                    "Document categories"
                ],
                "summary": "List: Document categories",
                "security": [
                    {
                        "bearer": [
                            "document_categories:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "scope",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "company",
                                "unit"
                            ]
                        },
                        "description": "Only company or only unit categories."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DocumentCategories"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/document-categories/{id}": {
            "get": {
                "tags": [
                    "Document categories"
                ],
                "summary": "One record: Document categories",
                "security": [
                    {
                        "bearer": [
                            "document_categories:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/DocumentCategories"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/documents": {
            "get": {
                "tags": [
                    "Documents"
                ],
                "summary": "List: Documents",
                "security": [
                    {
                        "bearer": [
                            "documents:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s documents."
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this category."
                    },
                    {
                        "name": "company",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: company documents only; false: unit documents only."
                    },
                    {
                        "name": "expires_before",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-12-31"
                        },
                        "description": "Expiring on or before this date."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Documents"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Documents"
                ],
                "summary": "Create: Documents",
                "security": [
                    {
                        "bearer": [
                            "documents:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DocumentsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Documents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/documents/{id}": {
            "get": {
                "tags": [
                    "Documents"
                ],
                "summary": "One record: Documents",
                "security": [
                    {
                        "bearer": [
                            "documents:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Documents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Documents"
                ],
                "summary": "Change: Documents",
                "security": [
                    {
                        "bearer": [
                            "documents:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DocumentsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Documents"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Documents"
                ],
                "summary": "Delete: Documents",
                "security": [
                    {
                        "bearer": [
                            "documents:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/service-categories": {
            "get": {
                "tags": [
                    "Service categories"
                ],
                "summary": "List: Service categories",
                "security": [
                    {
                        "bearer": [
                            "service_categories:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ServiceCategories"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/service-categories/{id}": {
            "get": {
                "tags": [
                    "Service categories"
                ],
                "summary": "One record: Service categories",
                "security": [
                    {
                        "bearer": [
                            "service_categories:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ServiceCategories"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/service-requests": {
            "get": {
                "tags": [
                    "Service requests"
                ],
                "summary": "List: Service requests",
                "security": [
                    {
                        "bearer": [
                            "service_requests:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "awaiting_approval",
                                "open",
                                "in_progress",
                                "resolved",
                                "unresolved",
                                "rejected",
                                "cancelled"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this category."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ServiceRequests"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Service requests"
                ],
                "summary": "Create: Service requests",
                "security": [
                    {
                        "bearer": [
                            "service_requests:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ServiceRequestsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ServiceRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/service-requests/{id}": {
            "get": {
                "tags": [
                    "Service requests"
                ],
                "summary": "One record: Service requests",
                "security": [
                    {
                        "bearer": [
                            "service_requests:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ServiceRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/service-requests/{id}/move": {
            "post": {
                "tags": [
                    "Service requests"
                ],
                "summary": "Move the request to another status (in_progress, resolved, unresolved, open, cancelled), as the key’s creator may. Unresolved and reopening need a comment.",
                "security": [
                    {
                        "bearer": [
                            "service_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "awaiting_approval",
                                            "open",
                                            "in_progress",
                                            "resolved",
                                            "unresolved",
                                            "rejected",
                                            "cancelled"
                                        ],
                                        "description": "The new status."
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000,
                                        "description": "Why (required for unresolved and when reopening)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ServiceRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/materials": {
            "get": {
                "tags": [
                    "Materials"
                ],
                "summary": "List: Materials",
                "security": [
                    {
                        "bearer": [
                            "materials:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Materials"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/materials/{id}": {
            "get": {
                "tags": [
                    "Materials"
                ],
                "summary": "One record: Materials",
                "security": [
                    {
                        "bearer": [
                            "materials:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Materials"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/material-requests": {
            "get": {
                "tags": [
                    "Material requests"
                ],
                "summary": "List: Material requests",
                "security": [
                    {
                        "bearer": [
                            "material_requests:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "new",
                                "taken",
                                "completed",
                                "cancelled"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MaterialRequests"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Material requests"
                ],
                "summary": "Create: Material requests",
                "security": [
                    {
                        "bearer": [
                            "material_requests:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MaterialRequestsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MaterialRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/material-requests/{id}": {
            "get": {
                "tags": [
                    "Material requests"
                ],
                "summary": "One record: Material requests",
                "security": [
                    {
                        "bearer": [
                            "material_requests:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MaterialRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/material-requests/{id}/take": {
            "post": {
                "tags": [
                    "Material requests"
                ],
                "summary": "Take a new request to handle.",
                "security": [
                    {
                        "bearer": [
                            "material_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MaterialRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/material-requests/{id}/complete": {
            "post": {
                "tags": [
                    "Material requests"
                ],
                "summary": "Complete it: the stock of tracked materials goes down.",
                "security": [
                    {
                        "bearer": [
                            "material_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MaterialRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/material-requests/{id}/cancel": {
            "post": {
                "tags": [
                    "Material requests"
                ],
                "summary": "Cancel a request not yet completed.",
                "security": [
                    {
                        "bearer": [
                            "material_requests:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MaterialRequests"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/surveys": {
            "get": {
                "tags": [
                    "Surveys"
                ],
                "summary": "List: Surveys",
                "security": [
                    {
                        "bearer": [
                            "surveys:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "published",
                                "closed"
                            ]
                        },
                        "description": "published or closed."
                    },
                    {
                        "name": "is_anonymous",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Surveys"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/surveys/{id}": {
            "get": {
                "tags": [
                    "Surveys"
                ],
                "summary": "One record: Surveys",
                "security": [
                    {
                        "bearer": [
                            "surveys:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Surveys"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/survey-responses": {
            "get": {
                "tags": [
                    "Survey answers"
                ],
                "summary": "List: Survey answers",
                "security": [
                    {
                        "bearer": [
                            "survey_responses:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "survey_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this survey’s answers."
                    },
                    {
                        "name": "employee_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this person’s answers."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SurveyResponses"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/survey-responses/{id}": {
            "get": {
                "tags": [
                    "Survey answers"
                ],
                "summary": "One record: Survey answers",
                "security": [
                    {
                        "bearer": [
                            "survey_responses:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SurveyResponses"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts": {
            "get": {
                "tags": [
                    "Posts"
                ],
                "summary": "List: Posts",
                "security": [
                    {
                        "bearer": [
                            "posts:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "post",
                                "news",
                                "announcement",
                                "promotion",
                                "contest"
                            ]
                        },
                        "description": "Only this type."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Posts"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Posts"
                ],
                "summary": "Create: Posts",
                "security": [
                    {
                        "bearer": [
                            "posts:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PostsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Posts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts/{id}": {
            "get": {
                "tags": [
                    "Posts"
                ],
                "summary": "One record: Posts",
                "security": [
                    {
                        "bearer": [
                            "posts:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Posts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/knowledge-articles": {
            "get": {
                "tags": [
                    "Knowledge base articles"
                ],
                "summary": "List: Knowledge base articles",
                "security": [
                    {
                        "bearer": [
                            "knowledge_articles:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this topic."
                    },
                    {
                        "name": "is_featured",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true or false."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/KnowledgeArticles"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/knowledge-articles/{id}": {
            "get": {
                "tags": [
                    "Knowledge base articles"
                ],
                "summary": "One record: Knowledge base articles",
                "security": [
                    {
                        "bearer": [
                            "knowledge_articles:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/KnowledgeArticles"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-contacts": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "List: Customers",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Name, email or phone containing this."
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "This exact email (case does not matter)."
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "This phone number (only its digits are compared)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "lead",
                                "customer",
                                "inactive"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s."
                    },
                    {
                        "name": "owner_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this user’s."
                    },
                    {
                        "name": "account_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this organisation’s."
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Only with this tag."
                    },
                    {
                        "name": "consent",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: only those who agree to marketing; false: only those who do not."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CrmContacts"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Customers"
                ],
                "summary": "Create: Customers",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmContactsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmContacts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-contacts/{id}": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "One record: Customers",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmContacts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Customers"
                ],
                "summary": "Change: Customers",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmContactsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmContacts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Customers"
                ],
                "summary": "Delete: Customers",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-contacts/{id}/consent": {
            "post": {
                "tags": [
                    "Customers"
                ],
                "summary": "Record that the person gave or withdrew their marketing consent, and how.",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "granted": {
                                        "type": "boolean",
                                        "example": true,
                                        "description": "true: given; false: withdrawn."
                                    },
                                    "channel": {
                                        "type": "string",
                                        "enum": [
                                            "form",
                                            "verbal",
                                            "email",
                                            "import",
                                            "api",
                                            "other"
                                        ],
                                        "example": "api",
                                        "description": "How: form, verbal, email, import, api or other (api when left out)."
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255,
                                        "description": "A note (for example where the form is kept)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmContacts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-contacts/{id}/erase": {
            "post": {
                "tags": [
                    "Customers"
                ],
                "summary": "Erase the person’s data at their request (GDPR). Irreversible.",
                "security": [
                    {
                        "bearer": [
                            "crm_contacts:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmContacts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-accounts": {
            "get": {
                "tags": [
                    "Customer organisations"
                ],
                "summary": "List: Customer organisations",
                "security": [
                    {
                        "bearer": [
                            "crm_accounts:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Name containing this."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s."
                    },
                    {
                        "name": "owner_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this user’s."
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Only with this tag."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CrmAccounts"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Customer organisations"
                ],
                "summary": "Create: Customer organisations",
                "security": [
                    {
                        "bearer": [
                            "crm_accounts:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmAccountsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmAccounts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-accounts/{id}": {
            "get": {
                "tags": [
                    "Customer organisations"
                ],
                "summary": "One record: Customer organisations",
                "security": [
                    {
                        "bearer": [
                            "crm_accounts:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmAccounts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Customer organisations"
                ],
                "summary": "Change: Customer organisations",
                "security": [
                    {
                        "bearer": [
                            "crm_accounts:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmAccountsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmAccounts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Customer organisations"
                ],
                "summary": "Delete: Customer organisations",
                "security": [
                    {
                        "bearer": [
                            "crm_accounts:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-pipelines": {
            "get": {
                "tags": [
                    "Sales pipelines"
                ],
                "summary": "List: Sales pipelines",
                "security": [
                    {
                        "bearer": [
                            "crm_pipelines:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CrmPipelines"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/crm-pipelines/{id}": {
            "get": {
                "tags": [
                    "Sales pipelines"
                ],
                "summary": "One record: Sales pipelines",
                "security": [
                    {
                        "bearer": [
                            "crm_pipelines:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmPipelines"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-deals": {
            "get": {
                "tags": [
                    "Deals"
                ],
                "summary": "List: Deals",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "won",
                                "lost"
                            ]
                        },
                        "description": "Only open, won or lost."
                    },
                    {
                        "name": "pipeline_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this pipeline’s."
                    },
                    {
                        "name": "stage_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only on this stage."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s."
                    },
                    {
                        "name": "owner_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this user’s."
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this customer’s."
                    },
                    {
                        "name": "account_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this organisation’s."
                    },
                    {
                        "name": "closed_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Closed on or after this date."
                    },
                    {
                        "name": "closed_until",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Closed on or before this date."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CrmDeals"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Deals"
                ],
                "summary": "Create: Deals",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmDealsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-deals/{id}": {
            "get": {
                "tags": [
                    "Deals"
                ],
                "summary": "One record: Deals",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Deals"
                ],
                "summary": "Change: Deals",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmDealsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Deals"
                ],
                "summary": "Delete: Deals",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-deals/{id}/move": {
            "post": {
                "tags": [
                    "Deals"
                ],
                "summary": "Move the deal to another stage (of its pipeline, or of another one — the deal moves with it).",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "stage_id": {
                                        "type": "integer",
                                        "example": 4,
                                        "description": "The stage to move to."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-deals/{id}/win": {
            "post": {
                "tags": [
                    "Deals"
                ],
                "summary": "Mark the deal won (its pipeline’s won stage).",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-deals/{id}/lose": {
            "post": {
                "tags": [
                    "Deals"
                ],
                "summary": "Mark the deal lost (its pipeline’s lost stage), with why.",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "lost_reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255,
                                        "example": "Price",
                                        "description": "Why it was lost."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-deals/{id}/reopen": {
            "post": {
                "tags": [
                    "Deals"
                ],
                "summary": "Take a closed deal back to its pipeline’s last open stage.",
                "security": [
                    {
                        "bearer": [
                            "crm_deals:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmDeals"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-activities": {
            "get": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "List: Customer activities",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "call",
                                "meeting",
                                "visit",
                                "email",
                                "task",
                                "note",
                                "purchase"
                            ]
                        },
                        "description": "Only this type."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s."
                    },
                    {
                        "name": "owner_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this user’s."
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this customer’s."
                    },
                    {
                        "name": "deal_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this deal’s."
                    },
                    {
                        "name": "done",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: only done; false: only still to do."
                    },
                    {
                        "name": "due_before",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Due before this moment."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CrmActivities"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "Create: Customer activities",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmActivitiesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmActivities"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-activities/{id}": {
            "get": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "One record: Customer activities",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmActivities"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "Change: Customer activities",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmActivitiesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmActivities"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "Delete: Customer activities",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-activities/{id}/complete": {
            "post": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "Mark a task done (now).",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmActivities"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-activities/{id}/reopen": {
            "post": {
                "tags": [
                    "Customer activities"
                ],
                "summary": "Mark it not done again (not for purchases).",
                "security": [
                    {
                        "bearer": [
                            "crm_activities:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmActivities"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-feedback": {
            "get": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "List: Customer feedback",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "feedback",
                                "complaint"
                            ]
                        },
                        "description": "Only feedback or only complaints."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "resolved"
                            ]
                        },
                        "description": "Only open or only resolved."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this unit’s."
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this customer’s."
                    },
                    {
                        "name": "received_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Received on or after this date."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CrmFeedback"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "Create: Customer feedback",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmFeedbackInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmFeedback"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-feedback/{id}": {
            "get": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "One record: Customer feedback",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmFeedback"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "Change: Customer feedback",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CrmFeedbackInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmFeedback"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "Delete: Customer feedback",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-feedback/{id}/resolve": {
            "post": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "Resolve a complaint, saying what was done.",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "resolution": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000,
                                        "example": "Called the customer and refunded the delivery.",
                                        "description": "What was done."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmFeedback"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/crm-feedback/{id}/reopen": {
            "post": {
                "tags": [
                    "Customer feedback"
                ],
                "summary": "Reopen a resolved complaint.",
                "security": [
                    {
                        "bearer": [
                            "crm_feedback:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CrmFeedback"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-partners": {
            "get": {
                "tags": [
                    "Partners"
                ],
                "summary": "List: Partners",
                "security": [
                    {
                        "bearer": [
                            "merch_partners:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Name containing the text."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: active ones only; false: inactive ones only."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MerchPartners"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Partners"
                ],
                "summary": "Create: Partners",
                "security": [
                    {
                        "bearer": [
                            "merch_partners:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MerchPartnersInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchPartners"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-partners/{id}": {
            "get": {
                "tags": [
                    "Partners"
                ],
                "summary": "One record: Partners",
                "security": [
                    {
                        "bearer": [
                            "merch_partners:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchPartners"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Partners"
                ],
                "summary": "Change: Partners",
                "security": [
                    {
                        "bearer": [
                            "merch_partners:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MerchPartnersInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchPartners"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/space-zone-types": {
            "get": {
                "tags": [
                    "Zone types"
                ],
                "summary": "List: Zone types",
                "security": [
                    {
                        "bearer": [
                            "space_zone_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: in use only; false: retired only."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SpaceZoneTypes"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Zone types"
                ],
                "summary": "Create: Zone types",
                "security": [
                    {
                        "bearer": [
                            "space_zone_types:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SpaceZoneTypesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpaceZoneTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/space-zone-types/{id}": {
            "get": {
                "tags": [
                    "Zone types"
                ],
                "summary": "One record: Zone types",
                "security": [
                    {
                        "bearer": [
                            "space_zone_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpaceZoneTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Zone types"
                ],
                "summary": "Change: Zone types",
                "security": [
                    {
                        "bearer": [
                            "space_zone_types:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SpaceZoneTypesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpaceZoneTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/space-zones": {
            "get": {
                "tags": [
                    "Zones in locations"
                ],
                "summary": "List: Zones in locations",
                "security": [
                    {
                        "bearer": [
                            "space_zones:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this location's."
                    },
                    {
                        "name": "zone_type_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only of this type."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "unavailable"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "is_display",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: display spaces only."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/SpaceZones"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Zones in locations"
                ],
                "summary": "Create: Zones in locations",
                "security": [
                    {
                        "bearer": [
                            "space_zones:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SpaceZonesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpaceZones"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/space-zones/{id}": {
            "get": {
                "tags": [
                    "Zones in locations"
                ],
                "summary": "One record: Zones in locations",
                "security": [
                    {
                        "bearer": [
                            "space_zones:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpaceZones"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Zones in locations"
                ],
                "summary": "Change: Zones in locations",
                "security": [
                    {
                        "bearer": [
                            "space_zones:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SpaceZonesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpaceZones"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Zones in locations"
                ],
                "summary": "Delete: Zones in locations",
                "security": [
                    {
                        "bearer": [
                            "space_zones:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/shelf-fixture-types": {
            "get": {
                "tags": [
                    "Fixtures and rates"
                ],
                "summary": "List: Fixtures and rates",
                "security": [
                    {
                        "bearer": [
                            "shelf_fixture_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: in use only."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ShelfFixtureTypes"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Fixtures and rates"
                ],
                "summary": "Create: Fixtures and rates",
                "security": [
                    {
                        "bearer": [
                            "shelf_fixture_types:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ShelfFixtureTypesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfFixtureTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/shelf-fixture-types/{id}": {
            "get": {
                "tags": [
                    "Fixtures and rates"
                ],
                "summary": "One record: Fixtures and rates",
                "security": [
                    {
                        "bearer": [
                            "shelf_fixture_types:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfFixtureTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Fixtures and rates"
                ],
                "summary": "Change: Fixtures and rates",
                "security": [
                    {
                        "bearer": [
                            "shelf_fixture_types:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ShelfFixtureTypesInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfFixtureTypes"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/shelf-planograms": {
            "get": {
                "tags": [
                    "Planograms"
                ],
                "summary": "List: Planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_planograms:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "fixture_type_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only with this fixture."
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: active only."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ShelfPlanograms"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Planograms"
                ],
                "summary": "Create: Planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_planograms:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ShelfPlanogramsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfPlanograms"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/shelf-planograms/{id}": {
            "get": {
                "tags": [
                    "Planograms"
                ],
                "summary": "One record: Planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_planograms:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfPlanograms"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Planograms"
                ],
                "summary": "Change: Planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_planograms:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ShelfPlanogramsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfPlanograms"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/shelf-placements": {
            "get": {
                "tags": [
                    "Placed planograms"
                ],
                "summary": "List: Placed planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_placements:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only in this location."
                    },
                    {
                        "name": "planogram_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this planogram."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "removed"
                            ]
                        },
                        "description": "Only with this status."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ShelfPlacements"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Placed planograms"
                ],
                "summary": "Create: Placed planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_placements:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ShelfPlacementsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfPlacements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/shelf-placements/{id}": {
            "get": {
                "tags": [
                    "Placed planograms"
                ],
                "summary": "One record: Placed planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_placements:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfPlacements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Placed planograms"
                ],
                "summary": "Change: Placed planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_placements:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ShelfPlacementsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShelfPlacements"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Placed planograms"
                ],
                "summary": "Delete: Placed planograms",
                "security": [
                    {
                        "bearer": [
                            "shelf_placements:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-campaigns": {
            "get": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "List: Campaigns",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "module",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "spaces",
                                "shelf"
                            ]
                        },
                        "description": "Only this module."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "launched",
                                "cancelled"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "partner_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this partner's."
                    },
                    {
                        "name": "active_on",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Only those running on this day (YYYY-MM-DD)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MerchCampaigns"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            },
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Create: Campaigns",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:write"
                        ]
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MerchCampaignsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchCampaigns"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "Too many requests."
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-campaigns/{id}": {
            "get": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "One record: Campaigns",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchCampaigns"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Change: Campaigns",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MerchCampaignsInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchCampaigns"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Delete: Campaigns",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "409": {
                        "description": "Still used elsewhere.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "411": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Too many requests."
                    },
                    "413": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-campaigns/{id}/launch": {
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Launch the draft: check room and send it to each location.",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchCampaigns"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-campaigns/{id}/cancel": {
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Cancel a launched campaign: it does not start where it was not put up, and comes down where it is up.",
                "security": [
                    {
                        "bearer": [
                            "merch_campaigns:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchCampaigns"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-executions": {
            "get": {
                "tags": [
                    "Implementation in locations"
                ],
                "summary": "List: Implementation in locations",
                "security": [
                    {
                        "bearer": [
                            "merch_executions:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "-id"
                        },
                        "description": "id, created_at or updated_at; a minus sign before it for descending."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only the records changed since this moment (ISO 8601)."
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only this campaign's."
                    },
                    {
                        "name": "work_unit_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Only in this location."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "waiting",
                                "pending",
                                "done",
                                "refused",
                                "removing",
                                "removed",
                                "cancelled"
                            ]
                        },
                        "description": "Only with this status."
                    },
                    {
                        "name": "module",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "spaces",
                                "shelf"
                            ]
                        },
                        "description": "Only this module."
                    },
                    {
                        "name": "late",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "true: late ones only."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MerchExecutions"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/Links"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/merch-executions/{id}": {
            "get": {
                "tags": [
                    "Implementation in locations"
                ],
                "summary": "One record: Implementation in locations",
                "security": [
                    {
                        "bearer": [
                            "merch_executions:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchExecutions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-executions/{id}/confirm": {
            "post": {
                "tags": [
                    "Implementation in locations"
                ],
                "summary": "Confirm it is up (with photos, if asked).",
                "security": [
                    {
                        "bearer": [
                            "merch_executions:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "photos": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object"
                                        },
                                        "example": [
                                            {
                                                "name": "raft.jpg",
                                                "content_base64": "/9j/4AAQ…"
                                            }
                                        ],
                                        "description": "Photos: [{name, content_base64}], JPEG/PNG/WebP, at most 10 MB each, at most 10."
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000,
                                        "description": "Notes."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchExecutions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-executions/{id}/refuse": {
            "post": {
                "tags": [
                    "Implementation in locations"
                ],
                "summary": "Say it cannot be put up, with the reason.",
                "security": [
                    {
                        "bearer": [
                            "merch_executions:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 2000,
                                        "example": "Afișele nu au ajuns în locație.",
                                        "description": "The reason."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchExecutions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-executions/{id}/reopen": {
            "post": {
                "tags": [
                    "Implementation in locations"
                ],
                "summary": "Ask a location that refused again (who runs the campaign).",
                "security": [
                    {
                        "bearer": [
                            "merch_executions:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchExecutions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch-executions/{id}/removed": {
            "post": {
                "tags": [
                    "Implementation in locations"
                ],
                "summary": "Confirm the materials were taken down.",
                "security": [
                    {
                        "bearer": [
                            "merch_executions:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "photos": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object"
                                        },
                                        "example": [
                                            {
                                                "name": "raft.jpg",
                                                "content_base64": "/9j/4AAQ…"
                                            }
                                        ],
                                        "description": "Photos after the take-down (optional): [{name, content_base64}]."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MerchExecutions"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "No such record in your company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "205": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/metrics": {
            "get": {
                "tags": [
                    "KPI values"
                ],
                "summary": "The metrics that accept values through the API",
                "security": [
                    {
                        "bearer": [
                            "metrics:write"
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    }
                }
            }
        },
        "/metrics/{key}/values": {
            "post": {
                "tags": [
                    "KPI values"
                ],
                "summary": "Push values for a metric and a period",
                "security": [
                    {
                        "bearer": [
                            "metrics:write"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "period",
                                    "values"
                                ],
                                "properties": {
                                    "period": {
                                        "type": "string",
                                        "example": "2026-09"
                                    },
                                    "values": {
                                        "type": "array",
                                        "maxItems": 1000,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "subject": {
                                                    "type": "string",
                                                    "example": "CJ01"
                                                },
                                                "value": {
                                                    "type": [
                                                        "number",
                                                        "string",
                                                        "null"
                                                    ],
                                                    "example": 1234.5
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "201": {
                        "description": "The key is missing, unknown or belongs to another company.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Suspended or expired key, missing scope, address not allowed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Too many requests."
                    },
                    "204": {
                        "description": "Invalid data; nothing was saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error",
                    "message"
                ],
                "properties": {
                    "error": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    }
                }
            },
            "ValidationError": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "Meta": {
                "type": "object",
                "properties": {
                    "page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    }
                }
            },
            "Links": {
                "type": "object",
                "properties": {
                    "next": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "GeoAreas": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 3,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 160,
                        "example": "Nord-Vest",
                        "description": "Name, unique among the areas with the same parent."
                    },
                    "level_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "regiune",
                        "description": "What this level is called (country, region, zone)."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 1,
                        "description": "The area it sits in; null for a top-level area. Never itself or one of its own sub-areas."
                    },
                    "sort": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 0,
                        "description": "Order among its siblings."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "GeoAreasInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 160,
                        "example": "Nord-Vest",
                        "description": "Name, unique among the areas with the same parent."
                    },
                    "level_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "regiune",
                        "description": "What this level is called (country, region, zone)."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 1,
                        "description": "The area it sits in; null for a top-level area. Never itself or one of its own sub-areas."
                    },
                    "sort": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 0,
                        "description": "Order among its siblings."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "WorkUnits": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 12,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 160,
                        "example": "Farmacia Verde Centru",
                        "description": "Name, unique in the company."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "CJ01",
                        "description": "Your own code, unique in the company (used to match KPI values)."
                    },
                    "geo_area_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 3,
                        "description": "The geographic area (region, country) it belongs to."
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "example": "Str. Memorandumului 10",
                        "description": "Street address."
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Cluj-Napoca",
                        "description": "City (from the official list for Romanian units)."
                    },
                    "county": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Cluj",
                        "description": "County or region."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "description": "Phone."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 160,
                        "description": "Email."
                    },
                    "opened_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2016-03-01",
                        "description": "Opening date."
                    },
                    "closed_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Closing date."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "WorkUnitsInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 160,
                        "example": "Farmacia Verde Centru",
                        "description": "Name, unique in the company."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "CJ01",
                        "description": "Your own code, unique in the company (used to match KPI values)."
                    },
                    "geo_area_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 3,
                        "description": "The geographic area (region, country) it belongs to."
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "example": "Str. Memorandumului 10",
                        "description": "Street address."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "description": "Phone."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 160,
                        "description": "Email."
                    },
                    "opened_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2016-03-01",
                        "description": "Opening date."
                    },
                    "closed_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Closing date."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "Departments": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Farmacie",
                        "description": "Name, unique in the company."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "FARM",
                        "description": "Your own code, unique in the company (used to match KPI values)."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The department it belongs to; never itself or one of its own sub-departments."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "DepartmentsInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Farmacie",
                        "description": "Name, unique in the company."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "FARM",
                        "description": "Your own code, unique in the company (used to match KPI values)."
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The department it belongs to; never itself or one of its own sub-departments."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "Positions": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 7,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Farmacist",
                        "description": "Name, unique in the company."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "FA",
                        "description": "Your own code, unique in the company."
                    },
                    "level": {
                        "type": "integer",
                        "example": 2,
                        "description": "Seniority, from 0 to 100."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "Description."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "PositionsInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Farmacist",
                        "description": "Name, unique in the company."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "FA",
                        "description": "Your own code, unique in the company."
                    },
                    "level": {
                        "type": "integer",
                        "example": 2,
                        "description": "Seniority, from 0 to 100."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "Description."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    }
                },
                "required": [
                    "name",
                    "level"
                ]
            },
            "Teams": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Proiect inventar",
                        "description": "Name, unique in the company."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "Description."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "member_ids": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            345,
                            346
                        ],
                        "description": "The employees in the team (read only; change them with add-member / remove-member)."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "TeamsInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Proiect inventar",
                        "description": "Name, unique in the company."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "Description."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id (see /custom-fields)."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "CustomFields": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 12,
                        "description": "Identifier; the key in a record’s custom_fields."
                    },
                    "entity": {
                        "type": "string",
                        "enum": [
                            "employee",
                            "work_unit",
                            "department",
                            "position",
                            "team",
                            "company"
                        ],
                        "readOnly": true,
                        "example": "employee",
                        "description": "The kind of record it belongs to."
                    },
                    "label": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Mărime uniformă",
                        "description": "Its name, in the language of the request (Accept-Language)."
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "text",
                            "textarea",
                            "number",
                            "date",
                            "boolean",
                            "select",
                            "multiselect",
                            "url"
                        ],
                        "readOnly": true,
                        "example": "select",
                        "description": "What it holds: text, textarea, number, date (Y-m-d), boolean, select, multiselect or url."
                    },
                    "options": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "id": "m",
                                "label": "M"
                            }
                        ],
                        "description": "The choices of a select or multiselect: id and label; the value stored is the id."
                    },
                    "is_required": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": false,
                        "description": "Whether a value is required."
                    },
                    "visibility": {
                        "type": "string",
                        "enum": [
                            "reach",
                            "sensitive"
                        ],
                        "readOnly": true,
                        "example": "reach",
                        "description": "reach (everyone who sees the employee) or sensitive."
                    },
                    "is_active": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "Employees": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "Identifier."
                    },
                    "employee_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "FV0012",
                        "description": "Your employee number, unique in the company (used to match KPI values)."
                    },
                    "first_name": {
                        "type": "string",
                        "maxLength": 80,
                        "example": "Ana",
                        "description": "First name."
                    },
                    "last_name": {
                        "type": "string",
                        "maxLength": 80,
                        "example": "Popescu",
                        "description": "Last name."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 160,
                        "example": "ana.popescu@example.com",
                        "description": "Work email."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "description": "Phone."
                    },
                    "birth_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Date of birth."
                    },
                    "hire_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2024-02-01",
                        "description": "Hire date (the first placement starts on it)."
                    },
                    "termination_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Leaving date."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive",
                            "terminated"
                        ],
                        "example": "active",
                        "description": "active, inactive or terminated."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "Unit of the current main placement; required on create, read-only after."
                    },
                    "department_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Department of the current main placement (create only)."
                    },
                    "position_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Position of the current main placement (create only)."
                    },
                    "has_login": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "Whether the person can sign in."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id; sensitive ones only with the sensitive scope."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "EmployeesInput": {
                "type": "object",
                "properties": {
                    "employee_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32,
                        "example": "FV0012",
                        "description": "Your employee number, unique in the company (used to match KPI values)."
                    },
                    "first_name": {
                        "type": "string",
                        "maxLength": 80,
                        "example": "Ana",
                        "description": "First name."
                    },
                    "last_name": {
                        "type": "string",
                        "maxLength": 80,
                        "example": "Popescu",
                        "description": "Last name."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 160,
                        "example": "ana.popescu@example.com",
                        "description": "Work email."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "description": "Phone."
                    },
                    "birth_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Date of birth."
                    },
                    "hire_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2024-02-01",
                        "description": "Hire date (the first placement starts on it)."
                    },
                    "termination_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Leaving date."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive",
                            "terminated"
                        ],
                        "example": "active",
                        "description": "active, inactive or terminated."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "Unit of the current main placement; required on create, read-only after."
                    },
                    "department_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Department of the current main placement (create only)."
                    },
                    "position_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Position of the current main placement (create only)."
                    },
                    "custom_fields": {
                        "type": "object",
                        "example": {
                            "12": "XL"
                        },
                        "description": "The company’s own fields, by field id; sensitive ones only with the sensitive scope."
                    }
                },
                "required": [
                    "first_name",
                    "last_name",
                    "work_unit_id"
                ]
            },
            "Placements": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 901,
                        "description": "Identifier."
                    },
                    "employee_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The person."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The unit."
                    },
                    "department_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The department."
                    },
                    "position_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The position."
                    },
                    "is_primary": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is the person’s main placement."
                    },
                    "valid_from": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-03-01",
                        "description": "First day."
                    },
                    "valid_to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Last day (empty: still current)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "PlacementsInput": {
                "type": "object",
                "properties": {
                    "employee_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The person."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The unit."
                    },
                    "department_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The department."
                    },
                    "position_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The position."
                    },
                    "is_primary": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is the person’s main placement."
                    },
                    "valid_from": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-03-01",
                        "description": "First day."
                    },
                    "valid_to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "Last day (empty: still current)."
                    }
                },
                "required": [
                    "employee_id",
                    "work_unit_id",
                    "valid_from"
                ]
            },
            "LeaveTypes": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 1,
                        "description": "Identifier."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "CO",
                        "description": "Short code."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Concediu de odihnă",
                        "description": "Name, in the language of the request (Accept-Language), falling back to the company’s language."
                    },
                    "uses_balance": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether days count against a yearly balance."
                    },
                    "default_entitlement": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 21,
                        "description": "Days a year for a full year’s work."
                    },
                    "is_paid": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "Paid leave."
                    },
                    "requires_attachment": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "A document must be attached (requests needing one are filed in the app)."
                    },
                    "requires_reference": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "A reference number is required."
                    },
                    "requires_replacement": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "A replacement colleague is required."
                    },
                    "is_active": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "Whether it can be requested."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "LeaveRequests": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 77,
                        "description": "Identifier."
                    },
                    "employee_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The person on leave."
                    },
                    "leave_type_id": {
                        "type": "integer",
                        "example": 1,
                        "description": "The kind of leave."
                    },
                    "starts_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-07-06",
                        "description": "First day."
                    },
                    "ends_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-07-10",
                        "description": "Last day."
                    },
                    "days": {
                        "type": "number",
                        "readOnly": true,
                        "example": 5,
                        "description": "Days counted (working days, holidays excluded)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "approved",
                            "rejected",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "pending",
                        "description": "pending, approved, rejected or cancelled."
                    },
                    "replacement_employee_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The colleague who covers."
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100,
                        "description": "Reference number (for example a medical certificate)."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Note."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Filed."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "LeaveRequestsInput": {
                "type": "object",
                "properties": {
                    "employee_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The person on leave."
                    },
                    "leave_type_id": {
                        "type": "integer",
                        "example": 1,
                        "description": "The kind of leave."
                    },
                    "starts_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-07-06",
                        "description": "First day."
                    },
                    "ends_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-07-10",
                        "description": "Last day."
                    },
                    "replacement_employee_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The colleague who covers."
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100,
                        "description": "Reference number (for example a medical certificate)."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Note."
                    }
                },
                "required": [
                    "employee_id",
                    "leave_type_id",
                    "starts_on",
                    "ends_on"
                ]
            },
            "LeaveBalances": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 55,
                        "description": "Identifier."
                    },
                    "employee_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "The person."
                    },
                    "leave_type_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 1,
                        "description": "The leave type."
                    },
                    "year": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2026,
                        "description": "The year."
                    },
                    "entitlement": {
                        "type": "number",
                        "example": 21,
                        "description": "Days for the year (0–365)."
                    },
                    "adjustment": {
                        "type": "number",
                        "example": 0,
                        "description": "Days added or taken (−365–365)."
                    },
                    "carried_over": {
                        "type": "number",
                        "example": 3,
                        "description": "Days carried over from last year."
                    },
                    "carried_over_expires_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-03-31",
                        "description": "Until when the carried days can be used."
                    },
                    "carried_usable": {
                        "type": "number",
                        "readOnly": true,
                        "example": 3,
                        "description": "Carried days still usable today."
                    },
                    "earlier": {
                        "type": "number",
                        "readOnly": true,
                        "example": 0,
                        "description": "Days still left from the years before the previous one, usable today."
                    },
                    "earlier_expires_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "description": "Until when the earliest of those days can be taken."
                    },
                    "used": {
                        "type": "number",
                        "readOnly": true,
                        "example": 5,
                        "description": "Days taken (approved)."
                    },
                    "pending": {
                        "type": "number",
                        "readOnly": true,
                        "example": 2,
                        "description": "Days asked, waiting for approval."
                    },
                    "available": {
                        "type": "number",
                        "readOnly": true,
                        "example": 17,
                        "description": "Days left."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Note."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Opened."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "LeaveBalancesInput": {
                "type": "object",
                "properties": {
                    "entitlement": {
                        "type": "number",
                        "example": 21,
                        "description": "Days for the year (0–365)."
                    },
                    "adjustment": {
                        "type": "number",
                        "example": 0,
                        "description": "Days added or taken (−365–365)."
                    },
                    "carried_over": {
                        "type": "number",
                        "example": 3,
                        "description": "Days carried over from last year."
                    },
                    "carried_over_expires_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-03-31",
                        "description": "Until when the carried days can be used."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Note."
                    }
                }
            },
            "CalendarEvents": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 410,
                        "description": "Identifier."
                    },
                    "event_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Event type."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Inventar trimestrial",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100000,
                        "example": "<p>Toată echipa.</p>",
                        "description": "Description (HTML; cleaned like any text written in the app)."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200,
                        "description": "Place."
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-07-06T15:00:00Z",
                        "description": "Start (ISO 8601)."
                    },
                    "ends_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-07-06T17:00:00Z",
                        "description": "End (ISO 8601)."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "All day."
                    },
                    "visibility": {
                        "type": "string",
                        "enum": [
                            "everyone",
                            "unit",
                            "participants"
                        ],
                        "example": "everyone",
                        "description": "everyone, unit (the unit’s people) or participants."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The unit, for visibility unit."
                    },
                    "participants": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            345,
                            346
                        ],
                        "description": "Employee ids invited."
                    },
                    "rsvp": {
                        "type": "boolean",
                        "description": "Asks who is coming."
                    },
                    "recurrence": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "weekly",
                            "biweekly",
                            "monthly",
                            "yearly"
                        ],
                        "description": "On create only: weekly, biweekly, monthly or yearly."
                    },
                    "recurrence_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "On create only: the last day of the series (at most two years ahead)."
                    },
                    "series_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The series it belongs to."
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was cancelled."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CalendarEventsInput": {
                "type": "object",
                "properties": {
                    "event_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Event type."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Inventar trimestrial",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100000,
                        "example": "<p>Toată echipa.</p>",
                        "description": "Description (HTML; cleaned like any text written in the app)."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200,
                        "description": "Place."
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-07-06T15:00:00Z",
                        "description": "Start (ISO 8601)."
                    },
                    "ends_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-07-06T17:00:00Z",
                        "description": "End (ISO 8601)."
                    },
                    "all_day": {
                        "type": "boolean",
                        "description": "All day."
                    },
                    "visibility": {
                        "type": "string",
                        "enum": [
                            "everyone",
                            "unit",
                            "participants"
                        ],
                        "example": "everyone",
                        "description": "everyone, unit (the unit’s people) or participants."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The unit, for visibility unit."
                    },
                    "participants": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            345,
                            346
                        ],
                        "description": "Employee ids invited."
                    },
                    "rsvp": {
                        "type": "boolean",
                        "description": "Asks who is coming."
                    },
                    "recurrence": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "weekly",
                            "biweekly",
                            "monthly",
                            "yearly"
                        ],
                        "description": "On create only: weekly, biweekly, monthly or yearly."
                    },
                    "recurrence_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "description": "On create only: the last day of the series (at most two years ahead)."
                    }
                },
                "required": [
                    "title",
                    "starts_at",
                    "ends_at",
                    "visibility"
                ]
            },
            "KpiMetrics": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 7,
                        "description": "Identifier."
                    },
                    "key": {
                        "type": "string",
                        "readOnly": true,
                        "example": "sales.actual",
                        "description": "The metric’s key, used in formulas and when sending values."
                    },
                    "label": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Sales",
                        "description": "Name, in the company’s language."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "What it measures."
                    },
                    "unit": {
                        "type": "string",
                        "enum": [
                            "currency",
                            "percent",
                            "count",
                            "score",
                            "days",
                            "hours",
                            "ratio"
                        ],
                        "readOnly": true,
                        "example": "currency",
                        "description": "Unit: currency, percent, count, score, days, hours or ratio."
                    },
                    "value_type": {
                        "type": "string",
                        "enum": [
                            "decimal",
                            "integer",
                            "percent",
                            "boolean"
                        ],
                        "readOnly": true,
                        "example": "decimal",
                        "description": "Kind of value: decimal, integer, percent or boolean."
                    },
                    "grain": {
                        "type": "string",
                        "enum": [
                            "employee",
                            "team",
                            "department",
                            "work_unit",
                            "geo_area",
                            "company"
                        ],
                        "readOnly": true,
                        "example": "employee",
                        "description": "Whom it is measured for: employee, team, department, work_unit, geo_area or company."
                    },
                    "period": {
                        "type": "string",
                        "enum": [
                            "day",
                            "week",
                            "month",
                            "quarter",
                            "year"
                        ],
                        "readOnly": true,
                        "example": "month",
                        "description": "How often: day, week, month, quarter or year."
                    },
                    "aggregation": {
                        "type": "string",
                        "enum": [
                            "sum",
                            "avg",
                            "last",
                            "min",
                            "max",
                            "count"
                        ],
                        "readOnly": true,
                        "example": "sum",
                        "description": "How values add up over a longer period."
                    },
                    "source_type": {
                        "type": "string",
                        "enum": [
                            "manual",
                            "import",
                            "module",
                            "derived",
                            "api",
                            "objective",
                            "review"
                        ],
                        "readOnly": true,
                        "example": "api",
                        "description": "Where its values come from (manual, import, api, a module…)."
                    },
                    "is_higher_better": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether a higher value is better."
                    },
                    "is_active": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether it is in use."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "MetricValues": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 5120,
                        "description": "Identifier."
                    },
                    "metric": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "sales.api",
                        "description": "The metric’s key."
                    },
                    "subject_type": {
                        "type": "string",
                        "enum": [
                            "employee",
                            "team",
                            "department",
                            "work_unit",
                            "geo_area",
                            "company"
                        ],
                        "readOnly": true,
                        "example": "employee",
                        "description": "The kind of subject (the metric’s grain)."
                    },
                    "subject_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The subject’s id (an employee, unit, department, area or team id; 0 for the company)."
                    },
                    "period": {
                        "type": "string",
                        "maxLength": 16,
                        "example": "2026-09",
                        "description": "The period’s key: 2026-09 (month), 2026-W38 (week), 2026-Q3, 2026, 2026-09-14 (day)."
                    },
                    "period_start": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-01",
                        "description": "First day of the period."
                    },
                    "period_end": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-30",
                        "description": "Last day of the period."
                    },
                    "value": {
                        "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                        ],
                        "example": "1234.5",
                        "description": "The value, as a number or text (“1234.5”, “1.234,5”, “87%”, true/false); null for no data. Stored as a decimal string."
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "manual",
                            "import",
                            "module",
                            "derived",
                            "api",
                            "objective",
                            "review"
                        ],
                        "readOnly": true,
                        "example": "api",
                        "description": "Where it came from."
                    },
                    "recorded_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was written."
                    }
                }
            },
            "MetricValuesInput": {
                "type": "object",
                "properties": {
                    "metric": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "sales.api",
                        "description": "The metric’s key."
                    },
                    "subject_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The subject’s id (an employee, unit, department, area or team id; 0 for the company)."
                    },
                    "period": {
                        "type": "string",
                        "maxLength": 16,
                        "example": "2026-09",
                        "description": "The period’s key: 2026-09 (month), 2026-W38 (week), 2026-Q3, 2026, 2026-09-14 (day)."
                    },
                    "value": {
                        "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                        ],
                        "example": "1234.5",
                        "description": "The value, as a number or text (“1234.5”, “1.234,5”, “87%”, true/false); null for no data. Stored as a decimal string."
                    }
                },
                "required": [
                    "metric",
                    "subject_id",
                    "period"
                ]
            },
            "KpiScorecards": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "Identifier of this version."
                    },
                    "family": {
                        "type": "string",
                        "readOnly": true,
                        "example": "9b2e0c1e-0f0a-4b47-9f3a-2c1d7e8a1b20",
                        "description": "The scorecard across its versions."
                    },
                    "version": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2,
                        "description": "Version number."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Pharmacist performance",
                        "description": "Name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Description."
                    },
                    "grain": {
                        "type": "string",
                        "enum": [
                            "employee",
                            "team",
                            "department",
                            "work_unit",
                            "geo_area",
                            "company"
                        ],
                        "readOnly": true,
                        "example": "employee",
                        "description": "Whom it scores."
                    },
                    "period": {
                        "type": "string",
                        "enum": [
                            "day",
                            "week",
                            "month",
                            "quarter",
                            "year"
                        ],
                        "readOnly": true,
                        "example": "month",
                        "description": "How often it scores."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ],
                        "readOnly": true,
                        "example": "published",
                        "description": "draft, published or archived."
                    },
                    "effective_from": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "description": "In force from."
                    },
                    "effective_to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "description": "In force until."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When this version was published."
                    },
                    "components": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "key": "sales",
                                "label": "Sales achievement",
                                "weight": "0.55"
                            }
                        ],
                        "description": "Its parts: key, label, weight (0–1), target, display format, whether the employee sees it."
                    },
                    "levels": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "name": "Good",
                                "min_score": "85",
                                "color": "#2B6CB0"
                            }
                        ],
                        "description": "Its levels: name, the lowest score that reaches it, colour."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "KpiResults": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 9811,
                        "description": "Identifier."
                    },
                    "scorecard_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "The scorecard version that scored it."
                    },
                    "scorecard": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Pharmacist performance",
                        "description": "Its name."
                    },
                    "subject_type": {
                        "type": "string",
                        "enum": [
                            "employee",
                            "team",
                            "department",
                            "work_unit",
                            "geo_area",
                            "company"
                        ],
                        "readOnly": true,
                        "example": "employee",
                        "description": "The kind of subject."
                    },
                    "subject_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "The subject’s id."
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Ana Popescu",
                        "description": "The subject’s name."
                    },
                    "period": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-01",
                        "description": "First day of the period."
                    },
                    "total": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "92.40",
                        "description": "The score, as a decimal string; null when there is no data."
                    },
                    "level": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Good",
                        "description": "The level reached."
                    },
                    "level_color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "#2B6CB0",
                        "description": "The level’s colour."
                    },
                    "bonus": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The bonus, when the scorecard computes one."
                    },
                    "parts": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "key": "sales",
                                "label": "Sales achievement",
                                "value": "104.2",
                                "points": "57.31"
                            }
                        ],
                        "description": "Each part: key, label, value and the points it brings (decimal strings; null for no data)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was computed."
                    }
                }
            },
            "Objectives": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 31,
                        "description": "Identifier."
                    },
                    "rule_id": {
                        "type": "integer",
                        "example": 2,
                        "description": "The rule that scores it (create only)."
                    },
                    "rule": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Focus products",
                        "description": "The rule’s name."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Vitamin C 1000",
                        "description": "Name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Description."
                    },
                    "period": {
                        "type": "string",
                        "maxLength": 16,
                        "example": "2026-09",
                        "description": "The period’s key, in the rule’s period (create only), for example 2026-09."
                    },
                    "period_start": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-01",
                        "description": "First day."
                    },
                    "period_end": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-30",
                        "description": "Last day."
                    },
                    "params": {
                        "type": "object",
                        "example": {
                            "bonus": "2"
                        },
                        "description": "Values for the rule’s parameters, by name (others are ignored); omitted: the rule’s defaults."
                    },
                    "targets": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "work_unit_id": 12,
                                "target": "30"
                            }
                        ],
                        "description": "Unit targets: a list of {work_unit_id, target}. When there are targets, the objective is only for those units."
                    },
                    "external_ref": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100,
                        "example": "CAMP-2026-09",
                        "description": "Your own reference (create only)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "ObjectivesInput": {
                "type": "object",
                "properties": {
                    "rule_id": {
                        "type": "integer",
                        "example": 2,
                        "description": "The rule that scores it (create only)."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Vitamin C 1000",
                        "description": "Name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Description."
                    },
                    "period": {
                        "type": "string",
                        "maxLength": 16,
                        "example": "2026-09",
                        "description": "The period’s key, in the rule’s period (create only), for example 2026-09."
                    },
                    "params": {
                        "type": "object",
                        "example": {
                            "bonus": "2"
                        },
                        "description": "Values for the rule’s parameters, by name (others are ignored); omitted: the rule’s defaults."
                    },
                    "targets": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "work_unit_id": 12,
                                "target": "30"
                            }
                        ],
                        "description": "Unit targets: a list of {work_unit_id, target}. When there are targets, the objective is only for those units."
                    },
                    "external_ref": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100,
                        "example": "CAMP-2026-09",
                        "description": "Your own reference (create only)."
                    }
                },
                "required": [
                    "rule_id",
                    "name",
                    "period"
                ]
            },
            "Reviews": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 812,
                        "description": "Identifier."
                    },
                    "form_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 3,
                        "description": "The grid version."
                    },
                    "form": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Monthly evaluation",
                        "description": "The grid’s name."
                    },
                    "employee_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "The person evaluated."
                    },
                    "evaluator_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 12,
                        "description": "The login of who evaluated."
                    },
                    "period_start": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-01",
                        "description": "First day of the period."
                    },
                    "period_end": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-09-30",
                        "description": "Last day."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "submitted",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "submitted",
                        "description": "submitted or cancelled."
                    },
                    "total_points": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "8.00",
                        "description": "Points obtained."
                    },
                    "max_points": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "10.00",
                        "description": "Points possible."
                    },
                    "result": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "80",
                        "description": "The result (points, or a percentage when the grid gives one)."
                    },
                    "comment": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The evaluator’s comment, as plain text."
                    },
                    "submitted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was submitted."
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was cancelled."
                    },
                    "answers": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "criterion_key": "attitude",
                                "selected": [
                                    "teamwork"
                                ],
                                "value": null,
                                "points": "2.00",
                                "comment": null
                            }
                        ],
                        "description": "Each criterion: key, the options chosen, a value, its points and a comment."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "Courses": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 7,
                        "description": "Identifier."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Siguranța la incendiu",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Short description, plain text."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Category."
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Obligatorii",
                        "description": "Category name."
                    },
                    "author": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 160,
                        "description": "Author."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ],
                        "example": "published",
                        "description": "draft, published or archived; only published courses can be assigned."
                    },
                    "estimated_minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 20,
                        "description": "Estimated duration in minutes."
                    },
                    "validity_months": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "How many months the certificate stays valid; empty: no expiry."
                    },
                    "issues_certificate": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether finishing it issues a certificate."
                    },
                    "recertifies": {
                        "type": "boolean",
                        "example": false,
                        "description": "Whether people are re-enrolled before the certificate expires."
                    },
                    "points": {
                        "type": "integer",
                        "example": 10,
                        "description": "Points earned on finishing."
                    },
                    "chapters_count": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "Number of chapters."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CoursesInput": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Siguranța la incendiu",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Short description, plain text."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Category."
                    },
                    "author": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 160,
                        "description": "Author."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "archived"
                        ],
                        "example": "published",
                        "description": "draft, published or archived; only published courses can be assigned."
                    },
                    "estimated_minutes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 20,
                        "description": "Estimated duration in minutes."
                    },
                    "validity_months": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "How many months the certificate stays valid; empty: no expiry."
                    },
                    "issues_certificate": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether finishing it issues a certificate."
                    },
                    "recertifies": {
                        "type": "boolean",
                        "example": false,
                        "description": "Whether people are re-enrolled before the certificate expires."
                    },
                    "points": {
                        "type": "integer",
                        "example": 10,
                        "description": "Points earned on finishing."
                    }
                },
                "required": [
                    "title",
                    "status",
                    "points"
                ]
            },
            "LearningAssignments": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 31,
                        "description": "Identifier."
                    },
                    "course_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 7,
                        "description": "The course (or test_id)."
                    },
                    "test_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "A standalone test (or course_id)."
                    },
                    "available_from": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-05-01",
                        "description": "From when it can be taken."
                    },
                    "due_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-05-31",
                        "description": "Due date."
                    },
                    "enrolls_newcomers": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether people who later match the targets are enrolled automatically."
                    },
                    "targets": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "type": "work_unit",
                                "id": 12
                            }
                        ],
                        "description": "Who: a list of {type, id}; type is all, employee, position, work_unit, department or geo_area (id empty for all)."
                    },
                    "enrollments_count": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 14,
                        "description": "People enrolled."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "LearningAssignmentsInput": {
                "type": "object",
                "properties": {
                    "course_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 7,
                        "description": "The course (or test_id)."
                    },
                    "test_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "A standalone test (or course_id)."
                    },
                    "available_from": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-05-01",
                        "description": "From when it can be taken."
                    },
                    "due_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-05-31",
                        "description": "Due date."
                    },
                    "enrolls_newcomers": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether people who later match the targets are enrolled automatically."
                    },
                    "targets": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "type": "work_unit",
                                "id": 12
                            }
                        ],
                        "description": "Who: a list of {type, id}; type is all, employee, position, work_unit, department or geo_area (id empty for all)."
                    }
                },
                "required": [
                    "available_from",
                    "targets"
                ]
            },
            "Enrollments": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 501,
                        "description": "Identifier."
                    },
                    "assignment_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 31,
                        "description": "The assignment it came from."
                    },
                    "employee_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "The person."
                    },
                    "course_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 7,
                        "description": "The course."
                    },
                    "test_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The test."
                    },
                    "available_from": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "description": "Available from."
                    },
                    "due_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-05-31",
                        "description": "Due date."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "assigned",
                            "in_progress",
                            "awaiting_grading",
                            "completed",
                            "failed",
                            "excused"
                        ],
                        "readOnly": true,
                        "example": "completed",
                        "description": "assigned, in_progress, awaiting_grading, completed, failed or excused."
                    },
                    "started_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Started."
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Finished."
                    },
                    "score": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 90,
                        "description": "Test score (%)."
                    },
                    "passed": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Whether the test was passed."
                    },
                    "extra_attempts": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 0,
                        "description": "Extra attempts granted."
                    },
                    "is_overdue": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": false,
                        "description": "Past due and not finished."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "Certificates": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 88,
                        "description": "Identifier."
                    },
                    "enrollment_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 501,
                        "description": "The enrolment that earned it."
                    },
                    "employee_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "The person."
                    },
                    "course_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 7,
                        "description": "The course."
                    },
                    "number": {
                        "type": "string",
                        "readOnly": true,
                        "example": "FV-2026-0042",
                        "description": "Certificate number."
                    },
                    "verification_code": {
                        "type": "string",
                        "readOnly": true,
                        "example": "K7Q2M9XA",
                        "description": "The public verification code."
                    },
                    "issued_on": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-05-12",
                        "description": "Issued on."
                    },
                    "expires_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "example": "2027-05-12",
                        "description": "Valid until; empty: no expiry."
                    },
                    "is_valid": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Valid today."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "Audits": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 19,
                        "description": "Identifier."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 12,
                        "description": "The unit audited."
                    },
                    "template_name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Verificare lunară farmacie",
                        "description": "The checklist used."
                    },
                    "auditor_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who conducted it (user)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "completed"
                        ],
                        "readOnly": true,
                        "example": "completed",
                        "description": "draft or completed."
                    },
                    "conducted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it took place."
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was completed."
                    },
                    "score": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 88.89,
                        "description": "Score (%)."
                    },
                    "pass_score": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 80,
                        "description": "Pass mark (%)."
                    },
                    "passed": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Passed (completed audits only)."
                    },
                    "critical_findings": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 0,
                        "description": "Critical items not met."
                    },
                    "is_self_check": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "Conducted by someone working in or managing the unit (not counted in audit KPIs)."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Notes."
                    },
                    "findings": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "section": "Frigider",
                                "item": "Termometrul este calibrat",
                                "weight": 2,
                                "critical": true,
                                "result": "not_ok",
                                "comment": "Ultima calibrare în martie."
                            }
                        ],
                        "description": "Each item: {id, section, item, weight, critical, result (ok, not_ok, na), comment}."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "AuditActionPlans": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "Identifier."
                    },
                    "audit_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 19,
                        "description": "The audit."
                    },
                    "result_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The finding it answers."
                    },
                    "description": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Calibrați termometrul frigiderului și păstrați certificatul.",
                        "description": "What must be done."
                    },
                    "responsible_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who must do it (user)."
                    },
                    "due_on": {
                        "type": "string",
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-05-20",
                        "description": "Due date."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "done",
                            "verified",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "open",
                        "description": "open, done, verified or cancelled."
                    },
                    "is_overdue": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "Open and past due."
                    },
                    "done_note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "What was done (and why it was reopened)."
                    },
                    "done_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Marked done."
                    },
                    "verified_by": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who verified it (user)."
                    },
                    "verified_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Verified."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "SsmTypes": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Instruire periodică",
                        "description": "Name."
                    },
                    "validity_months": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 6,
                        "description": "Months it stays valid; empty: no expiry."
                    },
                    "is_required": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "Required for everyone."
                    },
                    "is_active": {
                        "type": "boolean",
                        "readOnly": true,
                        "description": "In use."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "SsmRecords": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 120,
                        "description": "Identifier."
                    },
                    "employee_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The person."
                    },
                    "type_id": {
                        "type": "integer",
                        "example": 2,
                        "description": "The training or check."
                    },
                    "done_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-04-15",
                        "description": "When it was done (not in the future)."
                    },
                    "valid_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-10-15",
                        "description": "Valid until (from the type)."
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "valid",
                            "expiring",
                            "expired",
                            "missing",
                            "none"
                        ],
                        "readOnly": true,
                        "example": "valid",
                        "description": "Today: valid, expiring, expired."
                    },
                    "trainer": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200,
                        "description": "Trainer or doctor."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500,
                        "description": "Notes."
                    },
                    "recorded_by": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who recorded it (user)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "SsmRecordsInput": {
                "type": "object",
                "properties": {
                    "employee_id": {
                        "type": "integer",
                        "example": 345,
                        "description": "The person."
                    },
                    "type_id": {
                        "type": "integer",
                        "example": 2,
                        "description": "The training or check."
                    },
                    "done_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-04-15",
                        "description": "When it was done (not in the future)."
                    },
                    "trainer": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200,
                        "description": "Trainer or doctor."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500,
                        "description": "Notes."
                    }
                },
                "required": [
                    "employee_id",
                    "type_id",
                    "done_on"
                ]
            },
            "DocumentCategories": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Autorizații",
                        "description": "Name, in the language asked for."
                    },
                    "scope": {
                        "type": "string",
                        "enum": [
                            "company",
                            "unit"
                        ],
                        "readOnly": true,
                        "example": "company",
                        "description": "company (company documents) or unit (unit documents)."
                    },
                    "sort": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 1,
                        "description": "Position in lists."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "Documents": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 31,
                        "description": "Identifier."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Autorizație sanitară de funcționare",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "Description."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 4,
                        "description": "Category (see /document-categories)."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit it belongs to; empty for a company document. Set on create only."
                    },
                    "is_internal": {
                        "type": "boolean",
                        "example": false,
                        "description": "Seen only by who manages documents."
                    },
                    "expires_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-12-31",
                        "description": "Expiry date."
                    },
                    "expiry_state": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "valid",
                            "expiring",
                            "expired"
                        ],
                        "readOnly": true,
                        "example": "valid",
                        "description": "valid, expiring or expired (empty without an expiry date)."
                    },
                    "repeat_months": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "Renewed every this many months."
                    },
                    "alert_days": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            30,
                            7
                        ],
                        "description": "Days before expiry when reminders go out (at most 6)."
                    },
                    "versions": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2,
                        "description": "How many versions of the file there are."
                    },
                    "file_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "autorizatie.pdf",
                        "description": "The current file’s name."
                    },
                    "file_size": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 184220,
                        "description": "Its size in bytes."
                    },
                    "file_mime": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "application/pdf",
                        "description": "Its type."
                    },
                    "version_note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "A note on the file’s version (shown: the current version’s)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "DocumentsInput": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Autorizație sanitară de funcționare",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "Description."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 4,
                        "description": "Category (see /document-categories)."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit it belongs to; empty for a company document. Set on create only."
                    },
                    "is_internal": {
                        "type": "boolean",
                        "example": false,
                        "description": "Seen only by who manages documents."
                    },
                    "expires_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-12-31",
                        "description": "Expiry date."
                    },
                    "repeat_months": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "Renewed every this many months."
                    },
                    "alert_days": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            30,
                            7
                        ],
                        "description": "Days before expiry when reminders go out (at most 6)."
                    },
                    "file": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "content_base64": {
                                "type": "string"
                            }
                        },
                        "description": "The file: {\"name\": \"…\", \"content_base64\": \"…\"}. Required on create; on update it adds a version."
                    },
                    "version_note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "A note on the file’s version (shown: the current version’s)."
                    }
                },
                "required": [
                    "title",
                    "file"
                ]
            },
            "ServiceCategories": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Mentenanță și reparații",
                        "description": "Name, in the language asked for."
                    },
                    "is_active": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether requests can be filed under it."
                    },
                    "needs_approval": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": false,
                        "description": "Whether a request waits for approval before it opens."
                    },
                    "sort": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 1,
                        "description": "Position in lists."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "ServiceRequests": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 88,
                        "description": "Identifier."
                    },
                    "category_id": {
                        "type": "integer",
                        "example": 2,
                        "description": "Category (see /service-categories)."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The unit it is for."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Frigiderul de vaccinuri nu mai răcește",
                        "description": "Short title."
                    },
                    "description": {
                        "type": "string",
                        "maxLength": 5000,
                        "description": "What is wrong or needed."
                    },
                    "requested_by": {
                        "type": "integer",
                        "example": 17,
                        "description": "The user it is filed for (a person of the company); the key’s creator when left out."
                    },
                    "employee_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "The employee record of who filed it."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "awaiting_approval",
                            "open",
                            "in_progress",
                            "resolved",
                            "unresolved",
                            "rejected",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "open",
                        "description": "awaiting_approval, open, in_progress, resolved, unresolved, rejected or cancelled."
                    },
                    "assigned_to": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The user who took it."
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was closed."
                    },
                    "history": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "status_from": "open",
                                "status_to": "in_progress",
                                "comment": "Vine tehnicianul mâine.",
                                "user_id": 9,
                                "at": "2026-05-04T08:00:00Z"
                            }
                        ],
                        "description": "Every move: from, to, comment, by whom, when."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "ServiceRequestsInput": {
                "type": "object",
                "properties": {
                    "category_id": {
                        "type": "integer",
                        "example": 2,
                        "description": "Category (see /service-categories)."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The unit it is for."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Frigiderul de vaccinuri nu mai răcește",
                        "description": "Short title."
                    },
                    "description": {
                        "type": "string",
                        "maxLength": 5000,
                        "description": "What is wrong or needed."
                    },
                    "requested_by": {
                        "type": "integer",
                        "example": 17,
                        "description": "The user it is filed for (a person of the company); the key’s creator when left out."
                    }
                },
                "required": [
                    "category_id",
                    "work_unit_id",
                    "title",
                    "description"
                ]
            },
            "Materials": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 7,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Mănuși nitril",
                        "description": "Name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Description."
                    },
                    "unit": {
                        "type": "string",
                        "readOnly": true,
                        "example": "cutie",
                        "description": "Unit of measure."
                    },
                    "track_stock": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether stock is tracked."
                    },
                    "stock": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 35,
                        "description": "Stock now (empty when not tracked)."
                    },
                    "is_active": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether it can be requested."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "MaterialRequests": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 51,
                        "description": "Identifier."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The unit it is for."
                    },
                    "requested_by": {
                        "type": "integer",
                        "example": 17,
                        "description": "The user it is filed for; the key’s creator when left out."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "taken",
                            "completed",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "new",
                        "description": "new, taken, completed or cancelled."
                    },
                    "handled_by": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The user handling it."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "A note."
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "material_id": 7,
                                "quantity": 5
                            }
                        ],
                        "description": "What is asked for: [{\"material_id\": 7, \"quantity\": 5}] (at least one)."
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was completed."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "MaterialRequestsInput": {
                "type": "object",
                "properties": {
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The unit it is for."
                    },
                    "requested_by": {
                        "type": "integer",
                        "example": 17,
                        "description": "The user it is filed for; the key’s creator when left out."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "A note."
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "material_id": 7,
                                "quantity": 5
                            }
                        ],
                        "description": "What is asked for: [{\"material_id\": 7, \"quantity\": 5}] (at least one)."
                    }
                },
                "required": [
                    "work_unit_id",
                    "items"
                ]
            },
            "Surveys": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 5,
                        "description": "Identifier."
                    },
                    "title": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Climatul de lucru",
                        "description": "Title."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Description."
                    },
                    "is_anonymous": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether answers are anonymous."
                    },
                    "is_mandatory": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": false,
                        "description": "Whether answering is mandatory."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "published",
                            "closed"
                        ],
                        "readOnly": true,
                        "example": "closed",
                        "description": "published or closed."
                    },
                    "opens_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it opens."
                    },
                    "closes_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it closes."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was published."
                    },
                    "questions": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "id": 11,
                                "type": "single",
                                "text": "Ați recomanda compania?",
                                "is_required": true,
                                "options": [
                                    {
                                        "id": 31,
                                        "label": "Da"
                                    }
                                ]
                            }
                        ],
                        "description": "The questions: id, type (single, multiple, scale, text), text, required, options."
                    },
                    "results": {
                        "type": "object",
                        "readOnly": true,
                        "example": {
                            "hidden": false,
                            "responses": 14,
                            "questions": [
                                {
                                    "question_id": 11,
                                    "answered": 14,
                                    "counts": {
                                        "31": 11
                                    },
                                    "average": null
                                }
                            ]
                        },
                        "description": "Totals: hidden, sealed, responses, assigned, completed, and per question how many answered, counts per option or scale value, the average."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "SurveyResponses": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "readOnly": true,
                        "example": "9b2f4c1e-6f0a-4e7c-9a51-3c2d1e0f7a88",
                        "description": "Identifier (a UUID)."
                    },
                    "survey_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 5,
                        "description": "The survey."
                    },
                    "employee_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 345,
                        "description": "Who answered."
                    },
                    "submitted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When."
                    },
                    "answers": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "question_id": 11,
                                "option_id": 31,
                                "value": null,
                                "text": null
                            }
                        ],
                        "description": "The answers: question, chosen option, value (scale) or text."
                    }
                }
            },
            "Posts": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 120,
                        "description": "Identifier."
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "post",
                            "news",
                            "announcement",
                            "promotion",
                            "contest"
                        ],
                        "example": "announcement",
                        "description": "post, news, announcement, promotion or contest."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200,
                        "example": "Program de sărbători",
                        "description": "Title (optional)."
                    },
                    "body": {
                        "type": "string",
                        "maxLength": 200000,
                        "example": "Între 24 și 26 decembrie programul este 9–14.",
                        "description": "The text (plain text when read)."
                    },
                    "author": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Maria Matei",
                        "description": "Who wrote it."
                    },
                    "comments_enabled": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether people can comment."
                    },
                    "comments_count": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 3,
                        "description": "How many comments."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When it is published; a future moment schedules it."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "PostsInput": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "post",
                            "news",
                            "announcement",
                            "promotion",
                            "contest"
                        ],
                        "example": "announcement",
                        "description": "post, news, announcement, promotion or contest."
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200,
                        "example": "Program de sărbători",
                        "description": "Title (optional)."
                    },
                    "body": {
                        "type": "string",
                        "maxLength": 200000,
                        "example": "Între 24 și 26 decembrie programul este 9–14.",
                        "description": "The text (plain text when read)."
                    },
                    "comments_enabled": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether people can comment."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "When it is published; a future moment schedules it."
                    }
                },
                "required": [
                    "type",
                    "body"
                ]
            },
            "KnowledgeArticles": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 9,
                        "description": "Identifier."
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 2,
                        "description": "Topic."
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "example": "Operațiuni",
                        "description": "Topic name."
                    },
                    "title": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Recepția mărfii",
                        "description": "Title."
                    },
                    "summary": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Summary."
                    },
                    "body": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "The article, as plain text."
                    },
                    "is_featured": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether it is featured."
                    },
                    "published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "First published."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmContacts": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 120,
                        "description": "Identifier."
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Ioana",
                        "description": "First name."
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Pop",
                        "description": "Last name."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "example": "ioana.pop@example.com",
                        "description": "Email address (unique in the company, stored in lowercase)."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "0722 111 222",
                        "description": "Phone number, as written."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 31,
                        "description": "The organisation they belong to (see /crm-accounts)."
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "description": "Their role there."
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Cluj-Napoca",
                        "description": "City."
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2,
                        "example": "RO",
                        "description": "Country, as a two-letter ISO code."
                    },
                    "locale": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2,
                        "example": "ro",
                        "description": "The language to address them in (ro, en…)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "lead",
                            "customer",
                            "inactive"
                        ],
                        "example": "customer",
                        "description": "lead, customer or inactive. A purchase or a won deal makes a lead a customer."
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "walk_in",
                            "website",
                            "phone",
                            "referral",
                            "campaign",
                            "event",
                            "partner",
                            "other"
                        ],
                        "example": "walk_in",
                        "description": "Where they came from: walk_in, website, phone, referral, campaign, event, partner or other."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            "loyalty"
                        ],
                        "description": "Tags (lowercase, at most 20)."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    },
                    "marketing_consent": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether they agree to marketing now (read only — changed through the consent action)."
                    },
                    "consent_updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When the consent last changed."
                    },
                    "last_activity_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When something was last done with them."
                    },
                    "erased_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When their data was erased on request (the record is then read only)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmContactsInput": {
                "type": "object",
                "properties": {
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Ioana",
                        "description": "First name."
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Pop",
                        "description": "Last name."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "example": "ioana.pop@example.com",
                        "description": "Email address (unique in the company, stored in lowercase)."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "0722 111 222",
                        "description": "Phone number, as written."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 31,
                        "description": "The organisation they belong to (see /crm-accounts)."
                    },
                    "job_title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "description": "Their role there."
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Cluj-Napoca",
                        "description": "City."
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2,
                        "example": "RO",
                        "description": "Country, as a two-letter ISO code."
                    },
                    "locale": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2,
                        "example": "ro",
                        "description": "The language to address them in (ro, en…)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "lead",
                            "customer",
                            "inactive"
                        ],
                        "example": "customer",
                        "description": "lead, customer or inactive. A purchase or a won deal makes a lead a customer."
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "walk_in",
                            "website",
                            "phone",
                            "referral",
                            "campaign",
                            "event",
                            "partner",
                            "other"
                        ],
                        "example": "walk_in",
                        "description": "Where they came from: walk_in, website, phone, referral, campaign, event, partner or other."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            "loyalty"
                        ],
                        "description": "Tags (lowercase, at most 20)."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    }
                }
            },
            "CrmAccounts": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 31,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Hotel Sigma SRL",
                        "description": "Name (unique in the company)."
                    },
                    "registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "J12/345/2019",
                        "description": "Trade register number."
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "RO12345678",
                        "description": "VAT number."
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Hospitality",
                        "description": "Industry."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "example": "office@sigma.example",
                        "description": "Email address."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "0264 000 111",
                        "description": "Phone number."
                    },
                    "website": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "description": "Website."
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Address."
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Cluj-Napoca",
                        "description": "City."
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2,
                        "example": "RO",
                        "description": "Country, as a two-letter ISO code."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            "corporate",
                            "events"
                        ],
                        "description": "Tags (lowercase, at most 20)."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmAccountsInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Hotel Sigma SRL",
                        "description": "Name (unique in the company)."
                    },
                    "registration_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "J12/345/2019",
                        "description": "Trade register number."
                    },
                    "vat_number": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "RO12345678",
                        "description": "VAT number."
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Hospitality",
                        "description": "Industry."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "example": "office@sigma.example",
                        "description": "Email address."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "0264 000 111",
                        "description": "Phone number."
                    },
                    "website": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "description": "Website."
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255,
                        "description": "Address."
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Cluj-Napoca",
                        "description": "City."
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2,
                        "example": "RO",
                        "description": "Country, as a two-letter ISO code."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            "corporate",
                            "events"
                        ],
                        "description": "Tags (lowercase, at most 20)."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "CrmPipelines": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 1,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "readOnly": true,
                        "example": "Sales",
                        "description": "Name."
                    },
                    "is_default": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": true,
                        "description": "Whether new deals go here when no pipeline is given."
                    },
                    "sort": {
                        "type": "integer",
                        "readOnly": true,
                        "description": "Position in lists."
                    },
                    "stages": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "id": 3,
                                "name": "Proposal sent",
                                "kind": "open",
                                "probability": 60,
                                "sort": 20
                            },
                            {
                                "id": 5,
                                "name": "Won",
                                "kind": "won",
                                "probability": 100,
                                "sort": 40
                            }
                        ],
                        "description": "Its stages in order: id, name, kind (open, won or lost), probability (0–100) and sort."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmDeals": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 77,
                        "description": "Identifier."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Corporate rates 2027",
                        "description": "What is being sold."
                    },
                    "pipeline_id": {
                        "type": "integer",
                        "example": 1,
                        "description": "The pipeline (see /crm-pipelines). Set on create only."
                    },
                    "stage_id": {
                        "type": "integer",
                        "example": 3,
                        "description": "The stage. Set on create only; then through the actions."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "won",
                            "lost"
                        ],
                        "readOnly": true,
                        "example": "open",
                        "description": "open, won or lost — its stage’s kind."
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 120,
                        "description": "The customer (see /crm-contacts)."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 31,
                        "description": "The organisation (see /crm-accounts)."
                    },
                    "value": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 12500.5,
                        "description": "What it is worth."
                    },
                    "currency": {
                        "type": "string",
                        "maxLength": 3,
                        "example": "RON",
                        "description": "The value’s currency (ISO code); the company’s CRM currency when left out."
                    },
                    "expected_close_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-12-15",
                        "description": "When it is expected to close."
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When it was won or lost."
                    },
                    "lost_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Why it was lost."
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "walk_in",
                            "website",
                            "phone",
                            "referral",
                            "campaign",
                            "event",
                            "partner",
                            "other"
                        ],
                        "example": "referral",
                        "description": "Where it came from (as for customers)."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmDealsInput": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Corporate rates 2027",
                        "description": "What is being sold."
                    },
                    "pipeline_id": {
                        "type": "integer",
                        "example": 1,
                        "description": "The pipeline (see /crm-pipelines). Set on create only."
                    },
                    "stage_id": {
                        "type": "integer",
                        "example": 3,
                        "description": "The stage. Set on create only; then through the actions."
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 120,
                        "description": "The customer (see /crm-contacts)."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 31,
                        "description": "The organisation (see /crm-accounts)."
                    },
                    "value": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 12500.5,
                        "description": "What it is worth."
                    },
                    "currency": {
                        "type": "string",
                        "maxLength": 3,
                        "example": "RON",
                        "description": "The value’s currency (ISO code); the company’s CRM currency when left out."
                    },
                    "expected_close_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-12-15",
                        "description": "When it is expected to close."
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "walk_in",
                            "website",
                            "phone",
                            "referral",
                            "campaign",
                            "event",
                            "partner",
                            "other"
                        ],
                        "example": "referral",
                        "description": "Where it came from (as for customers)."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    }
                },
                "required": [
                    "title"
                ]
            },
            "CrmActivities": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 530,
                        "description": "Identifier."
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "call",
                            "meeting",
                            "visit",
                            "email",
                            "task",
                            "note",
                            "purchase"
                        ],
                        "example": "purchase",
                        "description": "call, meeting, visit, email, task, note or purchase."
                    },
                    "subject": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Receipt 1243",
                        "description": "Short description."
                    },
                    "body": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Details."
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 120,
                        "description": "The customer."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The organisation."
                    },
                    "deal_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The deal it belongs to."
                    },
                    "amount": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 240,
                        "description": "A purchase’s amount, in the company’s CRM currency (empty for the other types)."
                    },
                    "due_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-11-03T09:00:00Z",
                        "description": "When a task is due."
                    },
                    "done_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-11-02T15:20:00Z",
                        "description": "When it was done; empty for a task still to do."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmActivitiesInput": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "call",
                            "meeting",
                            "visit",
                            "email",
                            "task",
                            "note",
                            "purchase"
                        ],
                        "example": "purchase",
                        "description": "call, meeting, visit, email, task, note or purchase."
                    },
                    "subject": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Receipt 1243",
                        "description": "Short description."
                    },
                    "body": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Details."
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 120,
                        "description": "The customer."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The organisation."
                    },
                    "deal_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The deal it belongs to."
                    },
                    "amount": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 240,
                        "description": "A purchase’s amount, in the company’s CRM currency (empty for the other types)."
                    },
                    "due_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-11-03T09:00:00Z",
                        "description": "When a task is due."
                    },
                    "done_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-11-02T15:20:00Z",
                        "description": "When it was done; empty for a task still to do."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    }
                },
                "required": [
                    "type",
                    "subject"
                ]
            },
            "CrmFeedback": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 64,
                        "description": "Identifier."
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "feedback",
                            "complaint"
                        ],
                        "example": "feedback",
                        "description": "feedback or complaint. Set on create only."
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 120,
                        "description": "The customer."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The organisation."
                    },
                    "score": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 9,
                        "description": "From 0 to 10."
                    },
                    "comment": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "example": "Quick and friendly service.",
                        "description": "What they said."
                    },
                    "channel": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "in_person",
                            "phone",
                            "email",
                            "website",
                            "review_site",
                            "survey",
                            "other"
                        ],
                        "example": "in_person",
                        "description": "How it came: in_person, phone, email, website, review_site, survey or other."
                    },
                    "received_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-11-02",
                        "description": "When it was received (today when left out)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "resolved"
                        ],
                        "readOnly": true,
                        "example": "resolved",
                        "description": "open (a complaint not yet resolved) or resolved."
                    },
                    "resolved_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When the complaint was resolved."
                    },
                    "resolution": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "What was done about it."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "CrmFeedbackInput": {
                "type": "object",
                "properties": {
                    "kind": {
                        "type": "string",
                        "enum": [
                            "feedback",
                            "complaint"
                        ],
                        "example": "feedback",
                        "description": "feedback or complaint. Set on create only."
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 120,
                        "description": "The customer."
                    },
                    "account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "The organisation."
                    },
                    "score": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 9,
                        "description": "From 0 to 10."
                    },
                    "comment": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "example": "Quick and friendly service.",
                        "description": "What they said."
                    },
                    "channel": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "in_person",
                            "phone",
                            "email",
                            "website",
                            "review_site",
                            "survey",
                            "other"
                        ],
                        "example": "in_person",
                        "description": "How it came: in_person, phone, email, website, review_site, survey or other."
                    },
                    "received_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-11-02",
                        "description": "When it was received (today when left out)."
                    },
                    "work_unit_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12,
                        "description": "The unit (store, hotel, office) that serves it; empty for none."
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 17,
                        "description": "The user who looks after it; the key’s creator when left out on create."
                    }
                },
                "required": [
                    "kind"
                ]
            },
            "MerchPartners": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 3,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 150,
                        "example": "Dermalab",
                        "description": "The partner's name (unique in the company)."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "DLB",
                        "description": "Internal code."
                    },
                    "contact_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 150,
                        "example": "Ana Ionescu",
                        "description": "Contact person."
                    },
                    "contact_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "example": "ana@dermalab.example",
                        "description": "The contact's email."
                    },
                    "contact_phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "0722 000 111",
                        "description": "The contact's phone."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    },
                    "crm_account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 31,
                        "description": "The matching CRM organisation (see /crm-accounts), if any."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it can get new campaigns."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "MerchPartnersInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 150,
                        "example": "Dermalab",
                        "description": "The partner's name (unique in the company)."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "DLB",
                        "description": "Internal code."
                    },
                    "contact_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 150,
                        "example": "Ana Ionescu",
                        "description": "Contact person."
                    },
                    "contact_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 190,
                        "example": "ana@dermalab.example",
                        "description": "The contact's email."
                    },
                    "contact_phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "0722 000 111",
                        "description": "The contact's phone."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000,
                        "description": "Notes."
                    },
                    "crm_account_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 31,
                        "description": "The matching CRM organisation (see /crm-accounts), if any."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it can get new campaigns."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "SpaceZoneTypes": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 2,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Ramă click A2",
                        "description": "Name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Description."
                    },
                    "width_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 50,
                        "description": "Width, in centimetres."
                    },
                    "height_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 70,
                        "description": "Height, in centimetres."
                    },
                    "depth_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Depth, in centimetres."
                    },
                    "faces": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many faces (1 or 2: A, B)."
                    },
                    "capacity": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many items fit on one face."
                    },
                    "capacity_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60,
                        "example": "afișe A2",
                        "description": "What the capacity counts (e.g. \"A2 posters\")."
                    },
                    "is_display": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is a display space (can host campaigns)."
                    },
                    "monthly_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 150,
                        "description": "The monthly rate for one unit of capacity (suggests campaign values)."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is still used."
                    },
                    "sort": {
                        "type": "integer",
                        "example": 10,
                        "description": "Order in lists."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "SpaceZoneTypesInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Ramă click A2",
                        "description": "Name."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Description."
                    },
                    "width_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 50,
                        "description": "Width, in centimetres."
                    },
                    "height_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 70,
                        "description": "Height, in centimetres."
                    },
                    "depth_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Depth, in centimetres."
                    },
                    "faces": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many faces (1 or 2: A, B)."
                    },
                    "capacity": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many items fit on one face."
                    },
                    "capacity_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60,
                        "example": "afișe A2",
                        "description": "What the capacity counts (e.g. \"A2 posters\")."
                    },
                    "is_display": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is a display space (can host campaigns)."
                    },
                    "monthly_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 150,
                        "description": "The monthly rate for one unit of capacity (suggests campaign values)."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is still used."
                    },
                    "sort": {
                        "type": "integer",
                        "example": 10,
                        "description": "Order in lists."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "SpaceZones": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 41,
                        "description": "Identifier."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The location (unit) — on create only."
                    },
                    "zone_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 2,
                        "description": "The zone type (see /space-zone-types), if any."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Ramă click intrare",
                        "description": "Name (e.g. \"Totem right of the door\")."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Description."
                    },
                    "width_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 50,
                        "description": "Width, in centimetres."
                    },
                    "height_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 70,
                        "description": "Height, in centimetres."
                    },
                    "depth_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Depth, in centimetres."
                    },
                    "area_m2": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Area, in square metres."
                    },
                    "faces": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many faces (1 or 2)."
                    },
                    "capacity": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many items fit on one face."
                    },
                    "capacity_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60,
                        "example": "afișe A2",
                        "description": "What the capacity counts."
                    },
                    "is_display": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is a display space."
                    },
                    "monthly_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 150,
                        "description": "Monthly rate (written only by who sees money)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "unavailable"
                        ],
                        "example": "active",
                        "description": "active or unavailable (temporarily)."
                    },
                    "pin_x": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 42.5,
                        "description": "Position on the location's sketch, percent from the left (placed in the app)."
                    },
                    "pin_y": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 88,
                        "description": "Position on the location's sketch, percent from the top."
                    },
                    "sort": {
                        "type": "integer",
                        "example": 100,
                        "description": "Order in the location."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "SpaceZonesInput": {
                "type": "object",
                "properties": {
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The location (unit) — on create only."
                    },
                    "zone_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 2,
                        "description": "The zone type (see /space-zone-types), if any."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Ramă click intrare",
                        "description": "Name (e.g. \"Totem right of the door\")."
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000,
                        "description": "Description."
                    },
                    "width_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 50,
                        "description": "Width, in centimetres."
                    },
                    "height_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 70,
                        "description": "Height, in centimetres."
                    },
                    "depth_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Depth, in centimetres."
                    },
                    "area_m2": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Area, in square metres."
                    },
                    "faces": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many faces (1 or 2)."
                    },
                    "capacity": {
                        "type": "integer",
                        "example": 2,
                        "description": "How many items fit on one face."
                    },
                    "capacity_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60,
                        "example": "afișe A2",
                        "description": "What the capacity counts."
                    },
                    "is_display": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is a display space."
                    },
                    "monthly_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 150,
                        "description": "Monthly rate (written only by who sees money)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "unavailable"
                        ],
                        "example": "active",
                        "description": "active or unavailable (temporarily)."
                    },
                    "sort": {
                        "type": "integer",
                        "example": 100,
                        "description": "Order in the location."
                    }
                },
                "required": [
                    "work_unit_id",
                    "name"
                ]
            },
            "ShelfFixtureTypes": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 1,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Gondolă",
                        "description": "Name."
                    },
                    "face_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 25,
                        "description": "Rate per product facing, a month."
                    },
                    "meter_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Rate per metre of shelf, a month."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is still used."
                    },
                    "sort": {
                        "type": "integer",
                        "example": 10,
                        "description": "Order in lists."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "ShelfFixtureTypesInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120,
                        "example": "Gondolă",
                        "description": "Name."
                    },
                    "face_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 25,
                        "description": "Rate per product facing, a month."
                    },
                    "meter_price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Rate per metre of shelf, a month."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is still used."
                    },
                    "sort": {
                        "type": "integer",
                        "example": 10,
                        "description": "Order in lists."
                    }
                },
                "required": [
                    "name"
                ]
            },
            "ShelfPlanograms": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 4,
                        "description": "Identifier."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 150,
                        "example": "Capăt de raft vitamine",
                        "description": "Name (unique)."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "CR-VIT",
                        "description": "Internal code."
                    },
                    "fixture_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 2,
                        "description": "The fixture type (see /shelf-fixture-types)."
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Suplimente",
                        "description": "Product category."
                    },
                    "width_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 100,
                        "description": "Width, in centimetres."
                    },
                    "height_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 180,
                        "description": "Height, in centimetres."
                    },
                    "depth_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Depth, in centimetres."
                    },
                    "capacity_unit": {
                        "type": "string",
                        "enum": [
                            "faces",
                            "cm"
                        ],
                        "example": "faces",
                        "description": "faces: shelf capacity is in product facings; cm: in centimetres."
                    },
                    "instructions": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000,
                        "description": "How to set it out (formatted text, cleaned)."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is still set up."
                    },
                    "shelves": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "position": 1,
                                "label": null,
                                "capacity": 8,
                                "price_factor": 1.2
                            },
                            {
                                "position": 2,
                                "label": "La nivelul ochilor",
                                "capacity": 8,
                                "price_factor": 1.5
                            }
                        ],
                        "description": "The shelves, top to bottom: [{label, capacity, price_factor}] (position follows the list; price_factor is written only by who sees prices)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "ShelfPlanogramsInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 150,
                        "example": "Capăt de raft vitamine",
                        "description": "Name (unique)."
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 40,
                        "example": "CR-VIT",
                        "description": "Internal code."
                    },
                    "fixture_type_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 2,
                        "description": "The fixture type (see /shelf-fixture-types)."
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120,
                        "example": "Suplimente",
                        "description": "Product category."
                    },
                    "width_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 100,
                        "description": "Width, in centimetres."
                    },
                    "height_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 180,
                        "description": "Height, in centimetres."
                    },
                    "depth_cm": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Depth, in centimetres."
                    },
                    "capacity_unit": {
                        "type": "string",
                        "enum": [
                            "faces",
                            "cm"
                        ],
                        "example": "faces",
                        "description": "faces: shelf capacity is in product facings; cm: in centimetres."
                    },
                    "instructions": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000,
                        "description": "How to set it out (formatted text, cleaned)."
                    },
                    "is_active": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether it is still set up."
                    },
                    "shelves": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "position": 1,
                                "label": null,
                                "capacity": 8,
                                "price_factor": 1.2
                            },
                            {
                                "position": 2,
                                "label": "La nivelul ochilor",
                                "capacity": 8,
                                "price_factor": 1.5
                            }
                        ],
                        "description": "The shelves, top to bottom: [{label, capacity, price_factor}] (position follows the list; price_factor is written only by who sees prices)."
                    }
                },
                "required": [
                    "name",
                    "shelves"
                ]
            },
            "ShelfPlacements": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 88,
                        "description": "Identifier."
                    },
                    "planogram_id": {
                        "type": "integer",
                        "example": 4,
                        "description": "The planogram — on create only."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The location — on create only."
                    },
                    "label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60,
                        "example": "lângă casă",
                        "description": "A label telling it apart from another placement of the same planogram in the location."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "removed"
                        ],
                        "readOnly": true,
                        "example": "active",
                        "description": "active or removed."
                    },
                    "installed_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-02-18",
                        "description": "Date set up."
                    },
                    "removed_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "description": "Date taken out."
                    },
                    "local_note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "What differs here from the usual planogram."
                    },
                    "setup_cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Set-up cost."
                    },
                    "monthly_cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 25,
                        "description": "Monthly cost here (upkeep, depreciation)."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "ShelfPlacementsInput": {
                "type": "object",
                "properties": {
                    "planogram_id": {
                        "type": "integer",
                        "example": 4,
                        "description": "The planogram — on create only."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "example": 12,
                        "description": "The location — on create only."
                    },
                    "label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60,
                        "example": "lângă casă",
                        "description": "A label telling it apart from another placement of the same planogram in the location."
                    },
                    "installed_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "example": "2026-02-18",
                        "description": "Date set up."
                    },
                    "local_note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000,
                        "description": "What differs here from the usual planogram."
                    },
                    "setup_cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Set-up cost."
                    },
                    "monthly_cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 25,
                        "description": "Monthly cost here (upkeep, depreciation)."
                    }
                },
                "required": [
                    "planogram_id",
                    "work_unit_id"
                ]
            },
            "MerchCampaigns": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 15,
                        "description": "Identifier."
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "spaces",
                            "shelf"
                        ],
                        "example": "shelf",
                        "description": "spaces or shelf — on create only."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Dermalab – raftul de la ochi",
                        "description": "Campaign title."
                    },
                    "partner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 3,
                        "description": "The paying partner (see /merch-partners); empty: the company's own campaign."
                    },
                    "instructions": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000,
                        "description": "Implementation instructions (formatted text, cleaned)."
                    },
                    "starts_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-11-02",
                        "description": "First day."
                    },
                    "ends_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-11-30",
                        "description": "Last day."
                    },
                    "implement_days": {
                        "type": "integer",
                        "example": 3,
                        "description": "Days a location has to put it up, from the start."
                    },
                    "remove_days": {
                        "type": "integer",
                        "example": 2,
                        "description": "Days a location has to take it down, after the end."
                    },
                    "proof_required": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether a location must send photos when confirming."
                    },
                    "value": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 9600,
                        "description": "What the partner pays for the whole campaign, excluding VAT."
                    },
                    "cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 0,
                        "description": "What it costs the company (materials, set-up), excluding VAT."
                    },
                    "currency": {
                        "type": "string",
                        "readOnly": true,
                        "example": "RON",
                        "description": "The amounts' currency (from the module's settings)."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "launched",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "draft",
                        "description": "draft, launched or cancelled."
                    },
                    "phase": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "scheduled",
                            "running",
                            "ended",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "scheduled",
                        "description": "draft, scheduled, running, ended or cancelled."
                    },
                    "units": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            12,
                            13
                        ],
                        "description": "The locations (unit ids), together with rules."
                    },
                    "rules": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "planogram_id": 4,
                                "position": 2,
                                "quantity": 6,
                                "products": "Vitamina D3"
                            }
                        ],
                        "description": "The rules naming places, together with units. spaces: [{zone_type_id or zone_id, face (A/B), quantity}]; shelf: [{planogram_id or placement_id, position (shelf, from the top), quantity, products}]."
                    },
                    "targets": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "readOnly": true,
                        "example": [
                            {
                                "work_unit_id": 12,
                                "placement_id": 88,
                                "shelf_id": 210,
                                "quantity": 6,
                                "products": "Vitamina D3"
                            }
                        ],
                        "description": "The resulting places: per location, the zone and face or the placement and shelf, with the quantity."
                    },
                    "launched_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When launched."
                    },
                    "cancelled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When cancelled."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            },
            "MerchCampaignsInput": {
                "type": "object",
                "properties": {
                    "module": {
                        "type": "string",
                        "enum": [
                            "spaces",
                            "shelf"
                        ],
                        "example": "shelf",
                        "description": "spaces or shelf — on create only."
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 200,
                        "example": "Dermalab – raftul de la ochi",
                        "description": "Campaign title."
                    },
                    "partner_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 3,
                        "description": "The paying partner (see /merch-partners); empty: the company's own campaign."
                    },
                    "instructions": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 20000,
                        "description": "Implementation instructions (formatted text, cleaned)."
                    },
                    "starts_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-11-02",
                        "description": "First day."
                    },
                    "ends_on": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-11-30",
                        "description": "Last day."
                    },
                    "implement_days": {
                        "type": "integer",
                        "example": 3,
                        "description": "Days a location has to put it up, from the start."
                    },
                    "remove_days": {
                        "type": "integer",
                        "example": 2,
                        "description": "Days a location has to take it down, after the end."
                    },
                    "proof_required": {
                        "type": "boolean",
                        "example": true,
                        "description": "Whether a location must send photos when confirming."
                    },
                    "value": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 9600,
                        "description": "What the partner pays for the whole campaign, excluding VAT."
                    },
                    "cost": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "example": 0,
                        "description": "What it costs the company (materials, set-up), excluding VAT."
                    },
                    "units": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            12,
                            13
                        ],
                        "description": "The locations (unit ids), together with rules."
                    },
                    "rules": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        },
                        "example": [
                            {
                                "planogram_id": 4,
                                "position": 2,
                                "quantity": 6,
                                "products": "Vitamina D3"
                            }
                        ],
                        "description": "The rules naming places, together with units. spaces: [{zone_type_id or zone_id, face (A/B), quantity}]; shelf: [{planogram_id or placement_id, position (shelf, from the top), quantity, products}]."
                    }
                },
                "required": [
                    "module",
                    "title",
                    "starts_on",
                    "ends_on"
                ]
            },
            "MerchExecutions": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 501,
                        "description": "Identifier."
                    },
                    "campaign_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 15,
                        "description": "The campaign (see /merch-campaigns)."
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "spaces",
                            "shelf"
                        ],
                        "readOnly": true,
                        "example": "shelf",
                        "description": "spaces or shelf (the campaign's)."
                    },
                    "work_unit_id": {
                        "type": "integer",
                        "readOnly": true,
                        "example": 12,
                        "description": "The location."
                    },
                    "implementer_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "example": 17,
                        "description": "Who implements it specifically; empty: the location's managers."
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "waiting",
                            "pending",
                            "done",
                            "refused",
                            "removing",
                            "removed",
                            "cancelled"
                        ],
                        "readOnly": true,
                        "example": "pending",
                        "description": "waiting (not started yet), pending (to put up), done (up), refused, removing (to take down), removed or cancelled."
                    },
                    "late": {
                        "type": "boolean",
                        "readOnly": true,
                        "example": false,
                        "description": "Whether it was put up after the deadline, or is not up and the deadline has passed."
                    },
                    "due_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "example": "2026-11-04",
                        "description": "Put up by."
                    },
                    "done_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When confirmed."
                    },
                    "done_by": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who confirmed."
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Notes from the confirmation."
                    },
                    "refused_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When refused."
                    },
                    "refused_by": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who refused."
                    },
                    "refusal_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Why it cannot be done."
                    },
                    "remove_due_on": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date",
                        "readOnly": true,
                        "description": "Taken down by."
                    },
                    "removed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "readOnly": true,
                        "description": "When the take-down was confirmed."
                    },
                    "removed_by": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "readOnly": true,
                        "description": "Who confirmed the take-down."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Created."
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "description": "Last changed."
                    }
                }
            }
        },
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer",
                "description": "An API key, sent as Authorization: Bearer hq_<id>_<secret>."
            }
        }
    }
}