{
    "openapi": "3.1.0",
    "info": {
        "title": "jeCheck API",
        "version": "1.0.0",
        "description": "REST API of jeCheck — audits, tasks, SOP routines, HACCP, staff schedule, testing, knowledge base and analytics for multi-location businesses. Authenticate with `Authorization: Bearer <token>`. Every request acts with the permissions of the token's user. Guides: https://jecheck.io/developers",
        "contact": {
            "name": "jeCheck support",
            "email": "support@jecheck.io",
            "url": "https://jecheck.io/developers"
        },
        "termsOfService": "https://jecheck.io/legal/terms"
    },
    "servers": [
        {
            "url": "https://app.jecheck.io/api/ext/v1",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Account",
            "description": "Identify the token: the acting user, the company, the plan and the effective permissions. Call `GET /me` first to check that a key works.",
            "x-section": "account"
        },
        {
            "name": "Getting started",
            "description": "The setup checklist that guides a new company through jeCheck (locations, employees, checklists, the mobile app, the first audit, who fixes violations, the audit plan) and booking a free call with a jeCheck manager. Steps are marked done automatically from company data; optional steps can be skipped.",
            "x-section": "onboarding"
        },
        {
            "name": "Locations",
            "description": "Locations (venues, stores, branches) and regions: the list the token can see, location cards, staff and managers. Location ids are used as filters across the whole API. Creating and editing locations needs `locations.manage`; staff and managers — `locations.staff`.",
            "x-section": "locations"
        },
        {
            "name": "Employees",
            "description": "Employees of the company: list with filters, employee cards, adding and editing employees, deactivation, passwords and invitations, the positions directory. Visibility follows `users.view` (employees of the locations where it applies); email and phone are returned only with `users.contacts`.",
            "x-section": "users"
        },
        {
            "name": "Checklists",
            "description": "Audit checklists and their folders: list, read the full structure (sections, questions, answer types, weights, photo requirements, display conditions), create a checklist from a JSON structure, edit, duplicate, move, delete and restore, and control who may run a checklist in the mobile app.",
            "x-section": "checklists"
        },
        {
            "name": "Audits",
            "description": "Conducted audits (inspections by checklist): the audit journal with filters, the result card with sections, failed questions, comments and photos, PDF reports, deletion and submitting a new audit. Visibility follows the web journal — audits of the locations where the token has `audits.view`.",
            "x-section": "audits"
        },
        {
            "name": "Analytics",
            "description": "Audit analytics with the same numbers as the web analytics pages: company overview, location ranking and drill-down, checklist and question statistics, top violations, auditor strictness, plan fulfilment, corrective tasks, the AI control brief and employee tests. Figures cover only the locations where the token has `analytics.view`. Long lists end with an item `{\"_truncated\": N}` saying how many rows were cut.",
            "x-section": "analytics"
        },
        {
            "name": "Audit planner",
            "description": "Planned audits: the calendar of scheduled inspections with computed statuses (planned, in progress, overdue, missed, done), audit plans and recurring series across locations, rescheduling, reassigning, cancelling and marking as done, and plan templates.",
            "x-section": "planner"
        },
        {
            "name": "Tasks",
            "description": "Tasks and corrective actions: create, assign, comment, attach files, move through statuses. Visibility follows the web app: the token sees tasks of its locations (`tasks.view_all`), its teams, its projects and the tasks it is involved in.",
            "x-section": "tasks"
        },
        {
            "name": "Projects",
            "description": "Projects with task numbers (KEY-N), sections, board columns, milestones, custom fields, members with project roles, external guests, status updates and automation rules. Access follows the project role (viewer, commenter, editor, admin); `projects.manage` acts as admin in every project. Tasks themselves are managed in the Tasks section with `project_id`.",
            "x-section": "projects"
        },
        {
            "name": "Recurring projects",
            "description": "Recurring projects such as month-end closing: a template of items with due dates in working days relative to the period anchor date (e.g. the last day of the month), owners (a person, a team, a position at each location or the location manager), items repeated for every location, and dependencies. On schedule a regular project is created for each period (see the Projects and Tasks sections). The period summary is a matrix of items × locations with readiness, delays and the chains they hold. Configuring requires `projects.cycles` or the admin role in the recurring project; available on plans with recurring projects.",
            "x-section": "cycles"
        },
        {
            "name": "Processes & requests",
            "description": "Business processes (purchase, repair, refund…) with a request form and an approval route. Submit requests, see what waits for your decision, approve, return, reject, delegate, complete and track the route. Managing process definitions requires `processes.manage`; analytics — `processes.reports`.",
            "x-section": "processes"
        },
        {
            "name": "Teams",
            "description": "Departments and teams (maintenance, IT, cleaning…): members and heads, served locations, task queue and its distribution, team schedule, QR request points. `org.view` sees all teams, a team head sees own teams, members see their teams and queue; changes require `org.manage`. Taking a queued task — `tasks.take`.",
            "x-section": "teams"
        },
        {
            "name": "Automation",
            "description": "Closed-loop automation: scenarios that turn audit violations into corrective tasks (who fixes, deadline, photo \"after\", confirmation, reminders, escalation), and the loop steps of such tasks — upload a photo \"after\", submit, accept or return. Scenarios require `automation.manage` and the paid feature `automation`.",
            "x-section": "automation"
        },
        {
            "name": "Routines",
            "description": "Shift routines (SOPs without scores): routine templates with sections, steps and schedules; runs at locations with step marks, photos, completion and manager review. Visibility follows location permissions (`routines.view`, `routines.fill`, `routines.control`).",
            "x-section": "routines"
        },
        {
            "name": "HACCP",
            "description": "Food-safety journals (HACCP): today's checks per location, journal entries with automatic limit checks, deviations with corrective actions, registries (equipment, suppliers, verification, medical books) and the HACCP plan. Locations follow `haccp.view`; medical books require the sensitive `haccp.medical` permission.",
            "x-section": "haccp"
        },
        {
            "name": "Schedule & attendance",
            "description": "Staff schedule: shifts, publishing, open shifts, clock-in/out with breaks, who is on shift now, attendance records, timesheet, absences and shift swaps, availability, KPI and payroll. Location permissions follow `schedule.*`; pay rates and payroll require `pay.*` and are omitted otherwise.",
            "x-section": "schedule"
        },
        {
            "name": "HR",
            "description": "Employee HR records: the HR card, personal data, HR documents, hiring with onboarding checklists, transfers, dismissal and absences (vacations, sick leave). Permissions apply to the employee's locations; personal data, documents and pay rates are returned only with their own permissions and every view is written to the access log.",
            "x-section": "hr"
        },
        {
            "name": "Instructions",
            "description": "Company knowledge base: folders, documents with published versions, read acknowledgements and editing. Visibility follows the document and folder permissions of the acting user (\"who can view / who can edit\"); content is returned as Markdown, HTML or plain text and accepted as Markdown or HTML.",
            "x-section": "instructions"
        },
        {
            "name": "Employee testing",
            "description": "Knowledge tests for employees: build tests and questions, assign them to people, positions or locations, read results, grade open answers — and take assigned tests as the acting user. Results are limited to employees of the locations of the `testing.results` / `testing.review` permissions.",
            "x-section": "testing"
        },
        {
            "name": "Mystery shopper",
            "description": "Mystery shopper visits without an app: create visits with a personal link for a guest, review submitted questionnaires with automatic fraud flags, accept a visit into a regular audit, manage the guest pool and payouts, and order turnkey checks performed by jeCheck guests.",
            "x-section": "mystery"
        },
        {
            "name": "Dashboards",
            "description": "Custom dashboards of cards built from the metrics catalog (audits, tasks, HACCP, schedule…). List and read dashboards, get computed card data (always limited by the viewer's permissions and locations), create and edit dashboards and cards, share them with colleagues or the whole company (`dashboards.company`).",
            "x-section": "dashboards"
        },
        {
            "name": "Notifications",
            "description": "In-app notifications of the acting user (the bell in the web app and the Notifications screen in the mobile app): list, unread count, mark as read, and personal notification settings. A company key sees the notifications of its service user.",
            "x-section": "notifications"
        },
        {
            "name": "AI dispatcher",
            "description": "The AI dispatcher follows work through to the end in Telegram: it asks assignees about stuck and overdue tasks and audit findings, takes answers (buttons, short phrases, photos) and applies them in jeCheck, escalates only what was not resolved, sends urgent HACCP alerts and turns employee messages into requests. Settings, weekly metrics, conversations and Telegram connection of employees.",
            "x-section": "dispatcher"
        },
        {
            "name": "Guest feedback",
            "description": "Guest reviews of locations collected from map services (Yandex Maps, 2GIS, TripAdvisor, Delivery Club) with sentiment analysis, and customer appeals from the company Telegram / WhatsApp bot with replies. Reviews need `reviews.view` (limited to its locations); appeals need `appeals.view`.",
            "x-section": "feedback"
        },
        {
            "name": "Roles & permissions",
            "description": "The permission catalog, company roles, effective permissions of an employee and the access log. Changes follow the delegation rules of the web app: a non-administrator can grant only permissions they hold themselves, only on their own locations, and cannot change administrators.",
            "x-section": "access"
        },
        {
            "name": "Help center",
            "description": "Search and read the jeCheck help center (jecheck.io/docs): how features work, where settings are, rules for scores, permissions and plans. Articles are returned in Markdown, in English by default. Available to every token.",
            "x-section": "help"
        }
    ],
    "paths": {
        "/access/log": {
            "get": {
                "operationId": "accessLogList",
                "summary": "List access log entries",
                "description": "Changes of roles and permissions, administrators and managers, views of sensitive data, exports and denied attempts — newest first.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_log_list",
                "x-permissions": [
                    "access.log"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Entries where this employee is the actor or the subject",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "description": "Kind of entries",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "changes",
                                "view",
                                "export",
                                "denied"
                            ]
                        }
                    },
                    {
                        "name": "permission",
                        "in": "query",
                        "description": "Permission key",
                        "schema": {
                            "type": "string",
                            "maxLength": 64
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "From date (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "To date (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "event": {
                                                        "type": "string"
                                                    },
                                                    "event_label": {
                                                        "type": "string"
                                                    },
                                                    "actor": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "subject": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "role": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "permission": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "location": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "data": {
                                                        "type": "object",
                                                        "properties": {
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "ip": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 90211,
                                            "event": "role_assign",
                                            "event_label": "Role assigned",
                                            "actor": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "subject": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "role": {
                                                "id": 41,
                                                "name": "Auditor"
                                            },
                                            "permission": null,
                                            "location": null,
                                            "data": {
                                                "name": "Auditor"
                                            },
                                            "ip": "10.0.0.4",
                                            "created_at": "2026-11-03T10:15:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/access/permissions": {
            "get": {
                "operationId": "accessPermissionsList",
                "summary": "List the permission catalog",
                "description": "Every permission key with its group, label, description, whether it can be limited to locations (`scoped`), whether views are logged (`sensitive`) and the permissions it requires.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_permissions_list",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "group": {
                                                        "type": "string"
                                                    },
                                                    "group_label": {
                                                        "type": "string"
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "hint": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "scoped": {
                                                        "type": "boolean"
                                                    },
                                                    "sensitive": {
                                                        "type": "boolean"
                                                    },
                                                    "requires": {
                                                        "type": "array"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "key": "users.contacts",
                                            "group": "users",
                                            "group_label": "Employees",
                                            "label": "Employee phone and email",
                                            "hint": "See email and phone in the list and card",
                                            "description": "Email and phone of employees in the list, card and export.",
                                            "scoped": true,
                                            "sensitive": false,
                                            "requires": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/access/roles": {
            "get": {
                "operationId": "accessRolesList",
                "summary": "List roles",
                "description": "Company roles with their permissions and members. System roles (`system_key`: `employee` — everyone, `location_manager` — managers of locations and regions) are applied automatically and cannot be assigned or deleted.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_roles_list",
                "x-permissions": [
                    "access.manage",
                    "access.roles",
                    "access.log"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "system_key": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "permissions": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "key": {
                                                                    "type": "string"
                                                                },
                                                                "scope": {
                                                                    "type": "string"
                                                                },
                                                                "location_ids": {
                                                                    "type": "array"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "members": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 41,
                                            "system_key": null,
                                            "name": "Auditor",
                                            "description": "Runs audits and reviews results",
                                            "color": "#5249e6",
                                            "permissions": [
                                                {
                                                    "key": "audits.view",
                                                    "scope": "all",
                                                    "location_ids": []
                                                },
                                                {
                                                    "key": "tasks.view_all",
                                                    "scope": "list",
                                                    "location_ids": [
                                                        12,
                                                        14
                                                    ]
                                                }
                                            ],
                                            "members": [
                                                {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "accessRolesCreate",
                "summary": "Create a role",
                "description": "A non-administrator can include only permissions they hold, within their own locations. Written to the access log.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_roles_create",
                "x-permissions": [
                    "access.roles"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Role name (system roles cannot be renamed)",
                                        "minLength": 1,
                                        "maxLength": 120
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Hex color",
                                        "maxLength": 9
                                    },
                                    "permissions": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "description": "Permission key from `GET /access/permissions`",
                                                    "maxLength": 64
                                                },
                                                "scope": {
                                                    "type": "string",
                                                    "enum": [
                                                        "all",
                                                        "own",
                                                        "managed",
                                                        "list"
                                                    ],
                                                    "description": "Location scope, default `all`"
                                                },
                                                "location_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    },
                                                    "description": "Locations for `scope: list`"
                                                }
                                            },
                                            "required": [
                                                "key"
                                            ]
                                        },
                                        "description": "Full list of the role permissions (replaces the current list). Required dependencies are added automatically. `scope`: `all` — all locations, `own` — the member's own locations, `managed` — locations the member manages, `list` — `location_ids`",
                                        "maxItems": 300
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "color": "string",
                                "permissions": [
                                    {
                                        "key": "string",
                                        "scope": "all",
                                        "location_ids": [
                                            12,
                                            14
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "system_key": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "permissions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 41,
                                        "system_key": null,
                                        "name": "Auditor",
                                        "description": "Runs audits and reviews results",
                                        "color": "#5249e6",
                                        "permissions": [
                                            {
                                                "key": "audits.view",
                                                "scope": "all",
                                                "location_ids": []
                                            },
                                            {
                                                "key": "tasks.view_all",
                                                "scope": "list",
                                                "location_ids": [
                                                    12,
                                                    14
                                                ]
                                            }
                                        ],
                                        "members": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/access/roles/{id}": {
            "get": {
                "operationId": "accessRolesGet",
                "summary": "Retrieve a role",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_roles_get",
                "x-permissions": [
                    "access.manage",
                    "access.roles",
                    "access.log"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Role id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "system_key": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "permissions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 41,
                                        "system_key": null,
                                        "name": "Auditor",
                                        "description": "Runs audits and reviews results",
                                        "color": "#5249e6",
                                        "permissions": [
                                            {
                                                "key": "audits.view",
                                                "scope": "all",
                                                "location_ids": []
                                            },
                                            {
                                                "key": "tasks.view_all",
                                                "scope": "list",
                                                "location_ids": [
                                                    12,
                                                    14
                                                ]
                                            }
                                        ],
                                        "members": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "accessRolesUpdate",
                "summary": "Update a role",
                "description": "Partial update. `permissions`, when passed, replaces the whole list. Members get the new permissions immediately.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_roles_update",
                "x-permissions": [
                    "access.roles"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Role id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Role name (system roles cannot be renamed)",
                                        "minLength": 1,
                                        "maxLength": 120
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Hex color",
                                        "maxLength": 9
                                    },
                                    "permissions": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "description": "Permission key from `GET /access/permissions`",
                                                    "maxLength": 64
                                                },
                                                "scope": {
                                                    "type": "string",
                                                    "enum": [
                                                        "all",
                                                        "own",
                                                        "managed",
                                                        "list"
                                                    ],
                                                    "description": "Location scope, default `all`"
                                                },
                                                "location_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    },
                                                    "description": "Locations for `scope: list`"
                                                }
                                            },
                                            "required": [
                                                "key"
                                            ]
                                        },
                                        "description": "Full list of the role permissions (replaces the current list). Required dependencies are added automatically. `scope`: `all` — all locations, `own` — the member's own locations, `managed` — locations the member manages, `list` — `location_ids`",
                                        "maxItems": 300
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "color": "string",
                                "permissions": [
                                    {
                                        "key": "string",
                                        "scope": "all",
                                        "location_ids": [
                                            12,
                                            14
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "system_key": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "permissions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 41,
                                        "system_key": null,
                                        "name": "Auditor",
                                        "description": "Runs audits and reviews results",
                                        "color": "#5249e6",
                                        "permissions": [
                                            {
                                                "key": "audits.view",
                                                "scope": "all",
                                                "location_ids": []
                                            },
                                            {
                                                "key": "tasks.view_all",
                                                "scope": "list",
                                                "location_ids": [
                                                    12,
                                                    14
                                                ]
                                            }
                                        ],
                                        "members": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "accessRolesDelete",
                "summary": "Delete a role",
                "description": "Members lose the permissions of the role. System roles cannot be deleted.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_roles_delete",
                "x-permissions": [
                    "access.roles"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Role id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/access/roles/{id}/members": {
            "put": {
                "operationId": "accessRolesMembersSet",
                "summary": "Set role members",
                "description": "Replaces the members of a (non-system) role. Each assignment and removal is checked against the delegation rules and logged.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_roles_members_set",
                "x-permissions": [
                    "access.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Role id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Employee ids",
                                        "maxItems": 1000
                                    }
                                },
                                "required": [
                                    "user_ids"
                                ]
                            },
                            "example": {
                                "user_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "system_key": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "permissions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 41,
                                        "system_key": null,
                                        "name": "Auditor",
                                        "description": "Runs audits and reviews results",
                                        "color": "#5249e6",
                                        "permissions": [
                                            {
                                                "key": "audits.view",
                                                "scope": "all",
                                                "location_ids": []
                                            },
                                            {
                                                "key": "tasks.view_all",
                                                "scope": "list",
                                                "location_ids": [
                                                    12,
                                                    14
                                                ]
                                            }
                                        ],
                                        "members": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/access/users/{id}": {
            "get": {
                "operationId": "accessUsersGet",
                "summary": "Get permissions of an employee",
                "description": "Roles, personal grants and denials, and effective permissions with the locations where each applies (`location_ids: null` — all locations) and where it comes from. With only `users.access` the response contains just `user` and `account` (administrator and web-cabinet flags).",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_users_get",
                "x-permissions": [
                    "access.manage",
                    "access.roles",
                    "access.log",
                    "users.access"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Employee id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "account": {
                                                    "type": "object",
                                                    "properties": {
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "is_owner": {
                                                            "type": "boolean"
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "works_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "manages_locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "manages_regions": {
                                                            "type": "array"
                                                        },
                                                        "can_change_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "can_change_web_access": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "system_role_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "personal": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "effect": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "effective": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "sources": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "source": {
                                                                            "type": "string"
                                                                        },
                                                                        "role_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "role": {
                                                                            "type": "string"
                                                                        },
                                                                        "scope": {
                                                                            "type": "string"
                                                                        },
                                                                        "location_ids": {
                                                                            "type": "array"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "account": {
                                            "is_admin": false,
                                            "is_owner": false,
                                            "web_access": true,
                                            "works_anywhere": false,
                                            "manages_locations": [
                                                "Abay Ave"
                                            ],
                                            "manages_regions": [],
                                            "can_change_admin": true,
                                            "can_change_web_access": true
                                        },
                                        "role_ids": [
                                            41
                                        ],
                                        "system_role_ids": [
                                            1,
                                            2
                                        ],
                                        "personal": [
                                            {
                                                "key": "users.contacts",
                                                "effect": "grant",
                                                "scope": "list",
                                                "location_ids": [
                                                    12
                                                ]
                                            }
                                        ],
                                        "effective": [
                                            {
                                                "key": "audits.view",
                                                "location_ids": null,
                                                "sources": [
                                                    {
                                                        "source": "role",
                                                        "role_id": 41,
                                                        "role": "Auditor",
                                                        "scope": "all",
                                                        "location_ids": []
                                                    }
                                                ]
                                            }
                                        ],
                                        "can_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "accessUsersUpdate",
                "summary": "Set roles and personal permissions of an employee",
                "description": "Replaces the employee's roles (`role_ids`) and/or personal permissions (`personal`); an omitted field keeps its current value. Administrators and yourself cannot be changed. Every change is logged.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_users_update",
                "x-permissions": [
                    "access.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Employee id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "role_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Ids of company (non-system) roles",
                                        "maxItems": 100
                                    },
                                    "personal": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "description": "Permission key from `GET /access/permissions`",
                                                    "maxLength": 64
                                                },
                                                "effect": {
                                                    "type": "string",
                                                    "enum": [
                                                        "grant",
                                                        "deny"
                                                    ],
                                                    "description": "`grant` or `deny` (deny overrides roles)"
                                                },
                                                "scope": {
                                                    "type": "string",
                                                    "enum": [
                                                        "all",
                                                        "own",
                                                        "managed",
                                                        "list"
                                                    ],
                                                    "description": "Location scope, default `all`"
                                                },
                                                "location_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    },
                                                    "description": "Locations for `scope: list`"
                                                }
                                            },
                                            "required": [
                                                "key",
                                                "effect"
                                            ]
                                        },
                                        "description": "Personal grants and denials",
                                        "maxItems": 300
                                    }
                                }
                            },
                            "example": {
                                "role_ids": [
                                    12,
                                    14
                                ],
                                "personal": [
                                    {
                                        "key": "string",
                                        "effect": "grant",
                                        "scope": "all"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "account": {
                                                    "type": "object",
                                                    "properties": {
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "is_owner": {
                                                            "type": "boolean"
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "works_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "manages_locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "manages_regions": {
                                                            "type": "array"
                                                        },
                                                        "can_change_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "can_change_web_access": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "system_role_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "personal": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "effect": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "effective": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "sources": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "source": {
                                                                            "type": "string"
                                                                        },
                                                                        "role_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "role": {
                                                                            "type": "string"
                                                                        },
                                                                        "scope": {
                                                                            "type": "string"
                                                                        },
                                                                        "location_ids": {
                                                                            "type": "array"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "account": {
                                            "is_admin": false,
                                            "is_owner": false,
                                            "web_access": true,
                                            "works_anywhere": false,
                                            "manages_locations": [
                                                "Abay Ave"
                                            ],
                                            "manages_regions": [],
                                            "can_change_admin": true,
                                            "can_change_web_access": true
                                        },
                                        "role_ids": [
                                            41
                                        ],
                                        "system_role_ids": [
                                            1,
                                            2
                                        ],
                                        "personal": [
                                            {
                                                "key": "users.contacts",
                                                "effect": "grant",
                                                "scope": "list",
                                                "location_ids": [
                                                    12
                                                ]
                                            }
                                        ],
                                        "effective": [
                                            {
                                                "key": "audits.view",
                                                "location_ids": null,
                                                "sources": [
                                                    {
                                                        "source": "role",
                                                        "role_id": 41,
                                                        "role": "Auditor",
                                                        "scope": "all",
                                                        "location_ids": []
                                                    }
                                                ]
                                            }
                                        ],
                                        "can_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/access/users/{id}/account": {
            "patch": {
                "operationId": "accessUsersAccountUpdate",
                "summary": "Change administrator or web-cabinet access",
                "description": "`is_admin` — only an administrator can appoint or remove administrators (not themselves, not the company owner). `web_access: false` makes the employee \"app only\" (requires `users.access` for the employee). Logged.",
                "tags": [
                    "Roles & permissions"
                ],
                "x-mcp-tool": "access_users_account_update",
                "x-permissions": [
                    "access.manage",
                    "access.roles",
                    "access.log",
                    "users.access"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Employee id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "is_admin": {
                                        "type": "boolean"
                                    },
                                    "web_access": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "is_admin": true,
                                "web_access": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "account": {
                                                    "type": "object",
                                                    "properties": {
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "is_owner": {
                                                            "type": "boolean"
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "works_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "manages_locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "manages_regions": {
                                                            "type": "array"
                                                        },
                                                        "can_change_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "can_change_web_access": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "system_role_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "personal": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "effect": {
                                                                "type": "string"
                                                            },
                                                            "scope": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "effective": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "location_ids": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "sources": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "source": {
                                                                            "type": "string"
                                                                        },
                                                                        "role_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "role": {
                                                                            "type": "string"
                                                                        },
                                                                        "scope": {
                                                                            "type": "string"
                                                                        },
                                                                        "location_ids": {
                                                                            "type": "array"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "account": {
                                            "is_admin": false,
                                            "is_owner": false,
                                            "web_access": true,
                                            "works_anywhere": false,
                                            "manages_locations": [
                                                "Abay Ave"
                                            ],
                                            "manages_regions": [],
                                            "can_change_admin": true,
                                            "can_change_web_access": true
                                        },
                                        "role_ids": [
                                            41
                                        ],
                                        "system_role_ids": [
                                            1,
                                            2
                                        ],
                                        "personal": [
                                            {
                                                "key": "users.contacts",
                                                "effect": "grant",
                                                "scope": "list",
                                                "location_ids": [
                                                    12
                                                ]
                                            }
                                        ],
                                        "effective": [
                                            {
                                                "key": "audits.view",
                                                "location_ids": null,
                                                "sources": [
                                                    {
                                                        "source": "role",
                                                        "role_id": 41,
                                                        "role": "Auditor",
                                                        "scope": "all",
                                                        "location_ids": []
                                                    }
                                                ]
                                            }
                                        ],
                                        "can_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/checklists": {
            "get": {
                "operationId": "analyticsChecklists",
                "summary": "Get checklist statistics",
                "description": "Checklists for a period: audits, average score and change, pass rate, violations. With `checklist_id` — also `selected`: compliance by section, questions sorted by violation rate (most problematic first), locations, and violations repeated at the same location. Useful to find weak spots of a checklist.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_checklists",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_id",
                        "in": "query",
                        "description": "Checklist id for a detailed breakdown",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "prev_audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "prev_avg": {
                                                                "type": "number"
                                                            },
                                                            "delta": {
                                                                "type": "number"
                                                            },
                                                            "pass_rate": {
                                                                "type": "integer"
                                                            },
                                                            "locations": {
                                                                "type": "integer"
                                                            },
                                                            "violations": {
                                                                "type": "integer"
                                                            },
                                                            "viol_rate": {
                                                                "type": "number"
                                                            },
                                                            "last": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "selected": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "cur": {
                                                            "type": "object",
                                                            "properties": {
                                                                "audits": {
                                                                    "type": "integer"
                                                                },
                                                                "avg": {
                                                                    "type": "number"
                                                                },
                                                                "pass_rate": {
                                                                    "type": "integer"
                                                                },
                                                                "locations": {
                                                                    "type": "integer"
                                                                },
                                                                "auditors": {
                                                                    "type": "integer"
                                                                },
                                                                "violations": {
                                                                    "type": "integer"
                                                                },
                                                                "viol_per_audit": {
                                                                    "type": "number"
                                                                },
                                                                "viol_rate": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "prev": {
                                                            "type": "object",
                                                            "properties": {
                                                                "audits": {
                                                                    "type": "integer"
                                                                },
                                                                "avg": {
                                                                    "type": "number"
                                                                },
                                                                "pass_rate": {
                                                                    "type": "number"
                                                                },
                                                                "locations": {
                                                                    "type": "integer"
                                                                },
                                                                "auditors": {
                                                                    "type": "integer"
                                                                },
                                                                "violations": {
                                                                    "type": "integer"
                                                                },
                                                                "viol_per_audit": {
                                                                    "type": "number"
                                                                },
                                                                "viol_rate": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "sections": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "questions": {
                                                                        "type": "integer"
                                                                    },
                                                                    "violations": {
                                                                        "type": "integer"
                                                                    },
                                                                    "compliance": {
                                                                        "type": "number"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "questions_by_violations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "n": {
                                                                        "type": "integer"
                                                                    },
                                                                    "question": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "string"
                                                                    },
                                                                    "yes": {
                                                                        "type": "integer"
                                                                    },
                                                                    "no": {
                                                                        "type": "integer"
                                                                    },
                                                                    "skip": {
                                                                        "type": "integer"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    },
                                                                    "locations": {
                                                                        "type": "integer"
                                                                    },
                                                                    "comments": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "audits": {
                                                                        "type": "integer"
                                                                    },
                                                                    "avg": {
                                                                        "type": "number"
                                                                    },
                                                                    "min": {
                                                                        "type": "number"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "repeat_violations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "location": {
                                                                        "type": "string"
                                                                    },
                                                                    "question": {
                                                                        "type": "string"
                                                                    },
                                                                    "fails": {
                                                                        "type": "integer"
                                                                    },
                                                                    "audits": {
                                                                        "type": "integer"
                                                                    },
                                                                    "last": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "checklists": [
                                            {
                                                "id": 5845,
                                                "name": "Daily dining room check",
                                                "type": "points",
                                                "audits": 10,
                                                "prev_audits": 16,
                                                "avg": 79.1,
                                                "prev_avg": 77.7,
                                                "delta": 1.4,
                                                "pass_rate": 90,
                                                "locations": 5,
                                                "violations": 17,
                                                "viol_rate": 19.5,
                                                "last": "2026-10-15"
                                            }
                                        ],
                                        "selected": {
                                            "id": 5845,
                                            "name": "Daily dining room check",
                                            "cur": {
                                                "audits": 10,
                                                "avg": 79.1,
                                                "pass_rate": 90,
                                                "locations": 5,
                                                "auditors": 2,
                                                "violations": 17,
                                                "viol_per_audit": 1.7,
                                                "viol_rate": 19.5
                                            },
                                            "prev": {
                                                "audits": 16,
                                                "avg": 77.7,
                                                "pass_rate": 62.5,
                                                "locations": 5,
                                                "auditors": 2,
                                                "violations": 29,
                                                "viol_per_audit": 1.8,
                                                "viol_rate": 20.9
                                            },
                                            "sections": [
                                                {
                                                    "id": 21626,
                                                    "name": "Hall",
                                                    "questions": 4,
                                                    "violations": 6,
                                                    "compliance": 83.8
                                                }
                                            ],
                                            "questions_by_violations": [
                                                {
                                                    "n": 6,
                                                    "question": "Cleaning log is filled in",
                                                    "section": "Restroom",
                                                    "yes": 5,
                                                    "no": 5,
                                                    "skip": 0,
                                                    "rate": 50,
                                                    "locations": 4,
                                                    "comments": 5
                                                }
                                            ],
                                            "locations": [
                                                {
                                                    "id": 4638,
                                                    "name": "Park St",
                                                    "audits": 1,
                                                    "avg": 58.8,
                                                    "min": 58.8
                                                }
                                            ],
                                            "repeat_violations": [
                                                {
                                                    "location": "Embankment",
                                                    "question": "Staff wear uniforms and badges",
                                                    "fails": 3,
                                                    "audits": 4,
                                                    "last": "2026-10-14"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/control-brief": {
            "get": {
                "operationId": "analyticsControlBrief",
                "summary": "Get the AI control brief",
                "description": "The AI control brief from the home page: open problems found automatically (unstable and chronic violations, score drops, reused photos, soft auditors, missed plan, overdue tasks, HACCP, tests, instructions) with title, text, evidence facts, severity and status — most severe first, up to 15. With `signal` — one card by its UUID. Visibility follows `audits.view`; staff-related cards need `control.manage`.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_control_brief",
                "x-permissions": [
                    "audits.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "signal",
                        "in": "query",
                        "description": "UUID of one brief card",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "signals": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "detector": {
                                                                "type": "string"
                                                            },
                                                            "severity": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "facts": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "dept": {
                                                                        "type": "string"
                                                                    },
                                                                    "deviations": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue_hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "location_id": {
                                                                "type": "integer"
                                                            },
                                                            "checklist_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "ai": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "why": {
                                                                        "type": "string"
                                                                    },
                                                                    "advice": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "since": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "signals": [
                                            {
                                                "uuid": "4a4007c6-b9a3-461b-8f1b-e584fbe7c45d",
                                                "detector": "haccp",
                                                "severity": 3,
                                                "status": "open",
                                                "title": "Central: HACCP risk",
                                                "text": "1 critical deviation not fixed on time (log \"Storage temperature\", 21 h overdue).",
                                                "facts": {
                                                    "dept": "Central",
                                                    "deviations": 1,
                                                    "overdue_hours": 21
                                                },
                                                "location_id": 4637,
                                                "checklist_id": null,
                                                "ai": {
                                                    "why": "The fridge alarm was ignored overnight.",
                                                    "advice": "Check the fridge and log the corrective action."
                                                },
                                                "since": "2026-10-17"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/locations": {
            "get": {
                "operationId": "analyticsLocations",
                "summary": "Rank locations",
                "description": "Location ranking for a period: audits, average score and change vs the previous period, pass rate, violations per audit, last audit and days since. For \"which locations are worst\", \"where have we not audited for a long time\".",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_locations",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort order",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "worst",
                                "best",
                                "most_audits",
                                "longest_unaudited",
                                "biggest_drop"
                            ],
                            "default": "worst"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "How many locations to return",
                        "schema": {
                            "type": "integer",
                            "default": 20,
                            "minimum": 1,
                            "maximum": 50
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "total_locations": {
                                                    "type": "integer"
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "prev_audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "prev_avg": {
                                                                "type": "number"
                                                            },
                                                            "delta": {
                                                                "type": "number"
                                                            },
                                                            "pass_rate": {
                                                                "type": "integer"
                                                            },
                                                            "violations": {
                                                                "type": "integer"
                                                            },
                                                            "viol_per_audit": {
                                                                "type": "integer"
                                                            },
                                                            "last_audit": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days_since": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "total_locations": 5,
                                        "locations": [
                                            {
                                                "id": 4638,
                                                "name": "Station Sq",
                                                "audits": 3,
                                                "prev_audits": 12,
                                                "avg": 72.2,
                                                "prev_avg": 68.8,
                                                "delta": 3.4,
                                                "pass_rate": 67,
                                                "violations": 6,
                                                "viol_per_audit": 2,
                                                "last_audit": "2026-10-15",
                                                "days_since": 19
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/locations/{location_id}": {
            "get": {
                "operationId": "analyticsLocation",
                "summary": "Get location analytics",
                "description": "One location in detail for a period: KPIs with the previous period, checklists, top violations of the location, the last 12 audits with report links, auditors.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_location",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "cur": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audits": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": "number"
                                                        },
                                                        "pass_rate": {
                                                            "type": "integer"
                                                        },
                                                        "locations": {
                                                            "type": "integer"
                                                        },
                                                        "auditors": {
                                                            "type": "integer"
                                                        },
                                                        "violations": {
                                                            "type": "integer"
                                                        },
                                                        "viol_per_audit": {
                                                            "type": "number"
                                                        },
                                                        "viol_rate": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "prev": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audits": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": "number"
                                                        },
                                                        "pass_rate": {
                                                            "type": "integer"
                                                        },
                                                        "locations": {
                                                            "type": "integer"
                                                        },
                                                        "auditors": {
                                                            "type": "integer"
                                                        },
                                                        "violations": {
                                                            "type": "integer"
                                                        },
                                                        "viol_per_audit": {
                                                            "type": "number"
                                                        },
                                                        "viol_rate": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "min": {
                                                                "type": "number"
                                                            },
                                                            "last": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "violations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question": {
                                                                "type": "string"
                                                            },
                                                            "checklist": {
                                                                "type": "string"
                                                            },
                                                            "section": {
                                                                "type": "string"
                                                            },
                                                            "fails": {
                                                                "type": "integer"
                                                            },
                                                            "answered": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            },
                                                            "locations": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "recent": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "result": {
                                                                "type": "number"
                                                            },
                                                            "date": {
                                                                "type": "string"
                                                            },
                                                            "checklist": {
                                                                "type": "string"
                                                            },
                                                            "auditor": {
                                                                "type": "string"
                                                            },
                                                            "report_url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "auditors": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "id": 4638,
                                        "name": "Embankment",
                                        "address": "Embankment, 3",
                                        "cur": {
                                            "audits": 7,
                                            "avg": 78.2,
                                            "pass_rate": 100,
                                            "locations": 1,
                                            "auditors": 3,
                                            "violations": 13,
                                            "viol_per_audit": 1.9,
                                            "viol_rate": 21.7
                                        },
                                        "prev": {
                                            "audits": 7,
                                            "avg": 90.4,
                                            "pass_rate": 100,
                                            "locations": 1,
                                            "auditors": 3,
                                            "violations": 5,
                                            "viol_per_audit": 0.7,
                                            "viol_rate": 10
                                        },
                                        "checklists": [
                                            {
                                                "id": 5845,
                                                "name": "Daily dining room check",
                                                "audits": 4,
                                                "avg": 77.8,
                                                "min": 72.2,
                                                "last": "2026-10-14"
                                            }
                                        ],
                                        "violations": [
                                            {
                                                "id": 197428,
                                                "question": "Staff wear uniforms and badges",
                                                "checklist": "Daily dining room check",
                                                "section": "Staff",
                                                "fails": 3,
                                                "answered": 4,
                                                "rate": 75,
                                                "locations": 1
                                            }
                                        ],
                                        "recent": [
                                            {
                                                "result": 77.8,
                                                "date": "2026-10-14 17:19",
                                                "checklist": "Daily dining room check",
                                                "auditor": "Marina Lebedeva",
                                                "report_url": "https://app.jecheck.io/api/reports/newVersionSavePdf/9a72f859-63a3-4046-9616-8aaf730073ff"
                                            }
                                        ],
                                        "auditors": [
                                            {
                                                "id": 6321,
                                                "name": "Marina Lebedeva",
                                                "audits": 4,
                                                "avg": 80.4
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/overview": {
            "get": {
                "operationId": "analyticsOverview",
                "summary": "Get the audit overview",
                "description": "Company summary for a period with the previous period for comparison: number of audits, average score, pass rate (≥ 70%), violations, location coverage, plan fulfilment, open and overdue tasks; trend by day/week/month; score distribution; 5 best and 5 worst locations; top violations; locations without audits; ready-made insights. Start here for \"how are we doing\" questions.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_overview",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "kpis": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audits": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "integer"
                                                                },
                                                                "prev": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        },
                                                        "avg": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "integer"
                                                                },
                                                                "prev": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "pass": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "number"
                                                                },
                                                                "prev": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "violations": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "integer"
                                                                },
                                                                "prev": {
                                                                    "type": "integer"
                                                                },
                                                                "per_audit": {
                                                                    "type": "number"
                                                                },
                                                                "prev_per_audit": {
                                                                    "type": "number"
                                                                },
                                                                "rate": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "coverage": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "prev": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        },
                                                        "auditors": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "integer"
                                                                },
                                                                "prev": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        },
                                                        "plan": {
                                                            "type": "object",
                                                            "properties": {
                                                                "value": {
                                                                    "type": "integer"
                                                                },
                                                                "prev": {
                                                                    "type": "integer"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "planned": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        },
                                                        "tasks": {
                                                            "type": "object",
                                                            "properties": {
                                                                "open": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "trend": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "bucket": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "pass": {
                                                                "type": "integer"
                                                            },
                                                            "violations": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "distribution": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "integer"
                                                            },
                                                            "tone": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "best_locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "delta": {
                                                                "type": "number"
                                                            }
                                                        }
                                                    }
                                                },
                                                "worst_locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "delta": {
                                                                "type": "number"
                                                            }
                                                        }
                                                    }
                                                },
                                                "top_violations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question": {
                                                                "type": "string"
                                                            },
                                                            "checklist": {
                                                                "type": "string"
                                                            },
                                                            "section": {
                                                                "type": "string"
                                                            },
                                                            "fails": {
                                                                "type": "integer"
                                                            },
                                                            "answered": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            },
                                                            "locations": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "locations_without_audits": {
                                                    "type": "array"
                                                },
                                                "insights": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "kpis": {
                                            "audits": {
                                                "value": 18,
                                                "prev": 48
                                            },
                                            "avg": {
                                                "value": 80,
                                                "prev": 75.9
                                            },
                                            "pass": {
                                                "value": 83.3,
                                                "prev": 64.6
                                            },
                                            "violations": {
                                                "value": 28,
                                                "prev": 90,
                                                "per_audit": 1.6,
                                                "prev_per_audit": 1.9,
                                                "rate": 19.4
                                            },
                                            "coverage": {
                                                "value": 5,
                                                "total": 5,
                                                "prev": 5
                                            },
                                            "auditors": {
                                                "value": 4,
                                                "prev": 6
                                            },
                                            "plan": {
                                                "value": 33,
                                                "prev": 75,
                                                "done": 8,
                                                "planned": 24
                                            },
                                            "tasks": {
                                                "open": 37,
                                                "overdue": 35
                                            }
                                        },
                                        "trend": [
                                            {
                                                "bucket": "2026-10-05",
                                                "audits": 1,
                                                "avg": 82.4,
                                                "pass": 100,
                                                "violations": 1
                                            }
                                        ],
                                        "distribution": [
                                            {
                                                "label": "under 50%",
                                                "value": 0,
                                                "tone": "danger"
                                            }
                                        ],
                                        "best_locations": [
                                            {
                                                "id": 4638,
                                                "name": "Park St",
                                                "audits": 3,
                                                "avg": 86.3,
                                                "delta": 30.9
                                            }
                                        ],
                                        "worst_locations": [
                                            {
                                                "id": 4638,
                                                "name": "Station Sq",
                                                "audits": 3,
                                                "avg": 72.2,
                                                "delta": 3.4
                                            }
                                        ],
                                        "top_violations": [
                                            {
                                                "id": 197426,
                                                "question": "Cleaning log is filled in",
                                                "checklist": "Daily dining room check",
                                                "section": "Restroom",
                                                "fails": 5,
                                                "answered": 10,
                                                "rate": 50,
                                                "locations": 4
                                            }
                                        ],
                                        "locations_without_audits": [],
                                        "insights": [
                                            "Average score rose by 4.1 pp: 80% vs 75.9% in the previous period."
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/plan": {
            "get": {
                "operationId": "analyticsPlan",
                "summary": "Get plan fulfilment",
                "description": "Audit plan fulfilment for a period by the planner rules (an audit counts within \"planned date ± tolerance\" for the same checklist and location): due / done / overdue (window still open) / missed and % with the previous period; breakdowns by location, auditor and checklist (worst first); missed audits; audits planned for the next 7 days; share of unplanned audits.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_plan",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "cur": {
                                                    "type": "object",
                                                    "properties": {
                                                        "due": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "missed": {
                                                            "type": "integer"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "prev": {
                                                    "type": "object",
                                                    "properties": {
                                                        "due": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "missed": {
                                                            "type": "integer"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "byLocation": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "due": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "missed": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "byAuditor": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "due": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "missed": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "byChecklist": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "due": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "missed": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "missed": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "location": {
                                                                "type": "string"
                                                            },
                                                            "checklist": {
                                                                "type": "string"
                                                            },
                                                            "auditor": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "upcoming": {
                                                    "type": "integer"
                                                },
                                                "unplanned": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "unplanned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "hasPlan": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "cur": {
                                            "due": 24,
                                            "done": 8,
                                            "overdue": 0,
                                            "missed": 16,
                                            "rate": 33
                                        },
                                        "prev": {
                                            "due": 24,
                                            "done": 18,
                                            "overdue": 0,
                                            "missed": 6,
                                            "rate": 75
                                        },
                                        "byLocation": [
                                            {
                                                "id": 4638,
                                                "name": "Park St",
                                                "due": 8,
                                                "done": 1,
                                                "overdue": 0,
                                                "missed": 7,
                                                "rate": 13
                                            }
                                        ],
                                        "byAuditor": [
                                            {
                                                "id": 6324,
                                                "name": "Artem Volkov",
                                                "due": 4,
                                                "done": 0,
                                                "overdue": 0,
                                                "missed": 4,
                                                "rate": 0
                                            }
                                        ],
                                        "byChecklist": [
                                            {
                                                "id": 5848,
                                                "name": "Shift opening",
                                                "due": 4,
                                                "done": 0,
                                                "overdue": 0,
                                                "missed": 4,
                                                "rate": 0
                                            }
                                        ],
                                        "missed": [
                                            {
                                                "date": "2026-10-30",
                                                "location": "Park St",
                                                "checklist": "Shift opening",
                                                "auditor": "Artem Volkov"
                                            }
                                        ],
                                        "upcoming": 9,
                                        "unplanned": {
                                            "total": 18,
                                            "unplanned": 14
                                        },
                                        "hasPlan": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/tasks": {
            "get": {
                "operationId": "analyticsTasks",
                "summary": "Get task statistics",
                "description": "Tasks (including corrective actions from audits) for a period: created / closed / overdue, completion %, average closing time, on time; a snapshot of open tasks now (new, in progress, in review, overdue); breakdowns by priority, assignee and location; overdue tasks.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_tasks",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "cur": {
                                                    "type": "object",
                                                    "properties": {
                                                        "created": {
                                                            "type": "integer"
                                                        },
                                                        "created_done": {
                                                            "type": "integer"
                                                        },
                                                        "created_rejected": {
                                                            "type": "integer"
                                                        },
                                                        "created_open": {
                                                            "type": "integer"
                                                        },
                                                        "created_overdue": {
                                                            "type": "integer"
                                                        },
                                                        "completion": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "close_days": {
                                                            "type": "number"
                                                        },
                                                        "on_time": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "prev": {
                                                    "type": "object",
                                                    "properties": {
                                                        "created": {
                                                            "type": "integer"
                                                        },
                                                        "created_done": {
                                                            "type": "integer"
                                                        },
                                                        "created_rejected": {
                                                            "type": "integer"
                                                        },
                                                        "created_open": {
                                                            "type": "integer"
                                                        },
                                                        "created_overdue": {
                                                            "type": "integer"
                                                        },
                                                        "completion": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "close_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "on_time": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "snapshot": {
                                                    "type": "object",
                                                    "properties": {
                                                        "open": {
                                                            "type": "integer"
                                                        },
                                                        "new": {
                                                            "type": "integer"
                                                        },
                                                        "progress": {
                                                            "type": "integer"
                                                        },
                                                        "review": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "soon": {
                                                            "type": "integer"
                                                        },
                                                        "no_deadline": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "trackedSince": {
                                                    "type": "string"
                                                },
                                                "byPriority": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "integer"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "open": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "byExecutor": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "open": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "assigned": {
                                                                "type": "integer"
                                                            },
                                                            "completion": {
                                                                "type": "integer"
                                                            },
                                                            "close_days": {
                                                                "type": "number"
                                                            },
                                                            "on_time": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "byLocation": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "open": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "overdueList": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "deadline": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "priority": {
                                                                "type": "integer"
                                                            },
                                                            "location": {
                                                                "type": "string"
                                                            },
                                                            "executor": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "cur": {
                                            "created": 63,
                                            "created_done": 25,
                                            "created_rejected": 1,
                                            "created_open": 37,
                                            "created_overdue": 35,
                                            "completion": 40,
                                            "done": 25,
                                            "close_days": 0.4,
                                            "on_time": 56
                                        },
                                        "prev": {
                                            "created": 0,
                                            "created_done": 0,
                                            "created_rejected": 0,
                                            "created_open": 0,
                                            "created_overdue": 0,
                                            "completion": null,
                                            "done": 0,
                                            "close_days": null,
                                            "on_time": null
                                        },
                                        "snapshot": {
                                            "open": 37,
                                            "new": 30,
                                            "progress": 4,
                                            "review": 3,
                                            "overdue": 35,
                                            "soon": 0,
                                            "no_deadline": 0
                                        },
                                        "trackedSince": "2026-10-08 17:07:00",
                                        "byPriority": [
                                            {
                                                "key": 0,
                                                "label": "Urgent",
                                                "open": 1,
                                                "overdue": 1
                                            }
                                        ],
                                        "byExecutor": [
                                            {
                                                "id": 6323,
                                                "name": "Elena Morozova",
                                                "open": 14,
                                                "overdue": 12,
                                                "done": 5,
                                                "assigned": 19,
                                                "completion": 26,
                                                "close_days": 0.1,
                                                "on_time": 60
                                            }
                                        ],
                                        "byLocation": [
                                            {
                                                "id": 4637,
                                                "name": "Central",
                                                "open": 20,
                                                "overdue": 18,
                                                "done": 13
                                            }
                                        ],
                                        "overdueList": [
                                            {
                                                "uuid": "25180680-8ef5-a075-575b-cceed90f6bc0",
                                                "title": "Replace the broken fridge seal",
                                                "deadline": "2026-10-12",
                                                "days": 22,
                                                "priority": 1,
                                                "location": "Central",
                                                "executor": "Daria Kim"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/team": {
            "get": {
                "operationId": "analyticsTeam",
                "summary": "Get auditor statistics",
                "description": "Auditors for a period: number of audits, average score and deviation from the company average (strictness), locations, checklists, active days, photos / violations / comments per audit, last audit. Requires `analytics.team`; only audits of the token's locations are counted.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_team",
                "x-permissions": [
                    "analytics.team"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "company_avg": {
                                                    "type": "integer"
                                                },
                                                "auditors": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "audits": {
                                                                "type": "integer"
                                                            },
                                                            "prev_audits": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": "number"
                                                            },
                                                            "deviation": {
                                                                "type": "number"
                                                            },
                                                            "locations": {
                                                                "type": "integer"
                                                            },
                                                            "checklists": {
                                                                "type": "integer"
                                                            },
                                                            "active_days": {
                                                                "type": "integer"
                                                            },
                                                            "photos_per_audit": {
                                                                "type": "number"
                                                            },
                                                            "viol_per_audit": {
                                                                "type": "number"
                                                            },
                                                            "comments_per_audit": {
                                                                "type": "number"
                                                            },
                                                            "last": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "company_avg": 80,
                                        "auditors": [
                                            {
                                                "id": 6321,
                                                "name": "Marina Lebedeva",
                                                "audits": 10,
                                                "prev_audits": 19,
                                                "avg": 82.7,
                                                "deviation": 3.6,
                                                "locations": 5,
                                                "checklists": 3,
                                                "active_days": 7,
                                                "photos_per_audit": 0.6,
                                                "viol_per_audit": 1.4,
                                                "comments_per_audit": 1.4,
                                                "last": "2026-10-14"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/tests": {
            "get": {
                "operationId": "analyticsTests",
                "summary": "Get employee test statistics",
                "description": "Employee tests (Testing section): title, status, pass score, questions, attempts, average %, passed; assigned / passed / overdue assignments; answers waiting for manual review. Up to 40 tests, recently changed first.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_tests",
                "x-permissions": [
                    "testing.manage"
                ],
                "x-plan-feature": "testing",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Part of the test title",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "tests": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "category": {
                                                                "type": "string"
                                                            },
                                                            "pass_score": {
                                                                "type": "integer"
                                                            },
                                                            "questions": {
                                                                "type": "integer"
                                                            },
                                                            "attempts": {
                                                                "type": "integer"
                                                            },
                                                            "avg_percent": {
                                                                "type": "number"
                                                            },
                                                            "passed_attempts": {
                                                                "type": "integer"
                                                            },
                                                            "assigned": {
                                                                "type": "integer"
                                                            },
                                                            "assigned_passed": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "pending_review": {
                                                                "type": "integer"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "tests": [
                                            {
                                                "id": 12,
                                                "title": "Barista standards",
                                                "status": "published",
                                                "category": "Barista",
                                                "pass_score": 80,
                                                "questions": 8,
                                                "attempts": 4,
                                                "avg_percent": 68.5,
                                                "passed_attempts": 2,
                                                "assigned": 7,
                                                "assigned_passed": 2,
                                                "overdue": 4,
                                                "pending_review": 1,
                                                "url": "https://app.jecheck.io/ui/testing/12/edit"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/analytics/violations": {
            "get": {
                "operationId": "analyticsViolations",
                "summary": "List top violations",
                "description": "The most frequent violations (checklist questions answered \"violation\") for a period: how many times, out of how many answers, rate %, on how many locations, checklist and section.",
                "tags": [
                    "Analytics"
                ],
                "x-mcp-tool": "analytics_violations",
                "x-permissions": [
                    "analytics.view"
                ],
                "x-plan-feature": "analytics_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` requires `from` and `to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "How many violations to return",
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "minimum": 1,
                            "maximum": 30
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        },
                                                        "bucket": {
                                                            "type": "string"
                                                        },
                                                        "restricted_to_user_locations": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "violations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question": {
                                                                "type": "string"
                                                            },
                                                            "checklist": {
                                                                "type": "string"
                                                            },
                                                            "section": {
                                                                "type": "string"
                                                            },
                                                            "fails": {
                                                                "type": "integer"
                                                            },
                                                            "answered": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            },
                                                            "locations": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": {
                                            "from": "2026-10-05",
                                            "to": "2026-11-03",
                                            "previous": {
                                                "from": "2026-09-04",
                                                "to": "2026-10-04"
                                            },
                                            "bucket": "day",
                                            "restricted_to_user_locations": false
                                        },
                                        "violations": [
                                            {
                                                "id": 197426,
                                                "question": "Cleaning log is filled in",
                                                "checklist": "Daily dining room check",
                                                "section": "Restroom",
                                                "fails": 5,
                                                "answered": 10,
                                                "rate": 50,
                                                "locations": 4
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/audits": {
            "get": {
                "operationId": "auditsList",
                "summary": "List audits",
                "description": "The audit journal, newest first: checklist, location, auditor, result and status. `status`: `completed` — result 70% or higher, `failed` — below 70%, `in_progress` — not finished. Mystery-shopper audits have `mystery: true` and no auditor.",
                "tags": [
                    "Audits"
                ],
                "x-mcp-tool": "audits_list",
                "x-permissions": [
                    "audits.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Conducted on or after this date",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Conducted on or before this date",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only audits by these users",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "status[]",
                        "in": "query",
                        "description": "Filter by status: completed, failed, in_progress",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "result_from",
                        "in": "query",
                        "description": "Result from, %",
                        "schema": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "result_to",
                        "in": "query",
                        "description": "Result to, %",
                        "schema": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search by location, checklist or auditor name",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "created_since",
                        "in": "query",
                        "description": "Only audits received after this moment — use for incremental sync",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "date_desc",
                                "date_asc",
                                "result_asc",
                                "result_desc"
                            ],
                            "default": "date_desc"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "checklist": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "auditor": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "mystery": {
                                                        "type": "boolean"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "result": {
                                                        "type": "number"
                                                    },
                                                    "report_status": {
                                                        "type": "string"
                                                    },
                                                    "conducted_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "report_url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 99812,
                                            "uuid": "9a72f859-63a3-4046-9616-8aaf730073ff",
                                            "checklist": {
                                                "id": 5845,
                                                "name": "Daily dining room check"
                                            },
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "auditor": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "mystery": false,
                                            "status": "completed",
                                            "result": 82.4,
                                            "report_status": "ready",
                                            "conducted_at": "2026-11-03T09:40:00+05:00",
                                            "created_at": "2026-11-03T09:41:12+05:00",
                                            "report_url": "https://app.jecheck.io/api/reports/newVersionSavePdf/9a72f859-63a3-4046-9616-8aaf730073ff"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "auditsCreate",
                "summary": "Submit an audit",
                "description": "Submits a conducted audit for a checklist at a location — the same processing as the mobile app: the server scores every answer by the question type and settings, calculates the result, starts the PDF report and runs automation (corrective tasks for violations). The token user becomes the auditor; the checklist must be available to them and the location must be one where they work or may view audits. `yes_no` questions take `result` (`ok`, `violation`, `na`); `text` — `text`; other types — `value` (e.g. `{\"number\": 4.5}`, `{\"option\": \"a1\"}`, `{\"options\": [\"a1\",\"b2\"]}`, `{\"date\": \"2026-11-03\"}`, `{\"code\": \"4870001234567\"}`, `{\"user_id\": 311}`). Photos cannot be attached through the API yet.",
                "tags": [
                    "Audits"
                ],
                "x-mcp-tool": "audits_create",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "checklist_id": {
                                        "type": "integer",
                                        "description": "Checklist id"
                                    },
                                    "location_id": {
                                        "type": "integer",
                                        "description": "Location id"
                                    },
                                    "conducted_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "description": "When the audit was conducted (ISO 8601); default — now"
                                    },
                                    "answers": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "question_id": {
                                                    "type": "integer",
                                                    "description": "Question id (from `checklists.get`)"
                                                },
                                                "result": {
                                                    "type": "string",
                                                    "enum": [
                                                        "ok",
                                                        "violation",
                                                        "na"
                                                    ],
                                                    "description": "For `yes_no`: ok, violation or na; `na` also skips a question of another type"
                                                },
                                                "text": {
                                                    "type": "string",
                                                    "description": "Text answer (`text` type)",
                                                    "maxLength": 5000
                                                },
                                                "value": {
                                                    "type": "object",
                                                    "properties": {},
                                                    "additionalProperties": true,
                                                    "description": "Value for the other answer types"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Auditor comment",
                                                    "maxLength": 5000
                                                }
                                            },
                                            "required": [
                                                "question_id"
                                            ]
                                        },
                                        "description": "Answers; questions without an answer are not saved",
                                        "minItems": 1,
                                        "maxItems": 1000
                                    },
                                    "latitude": {
                                        "type": "number",
                                        "description": "Auditor geolocation"
                                    },
                                    "longitude": {
                                        "type": "number",
                                        "description": "Auditor geolocation"
                                    }
                                },
                                "required": [
                                    "checklist_id",
                                    "location_id",
                                    "answers"
                                ]
                            },
                            "example": {
                                "checklist_id": 42,
                                "location_id": 12,
                                "conducted_at": "2026-11-03T09:00:00+05:00",
                                "answers": [
                                    {
                                        "question_id": 42,
                                        "result": "ok",
                                        "text": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "mystery": {
                                                    "type": "boolean"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "result": {
                                                    "type": "number"
                                                },
                                                "report_status": {
                                                    "type": "string"
                                                },
                                                "conducted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "report_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "target": {
                                                    "type": "integer"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "failed_by": {
                                                    "type": "array"
                                                },
                                                "counts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "checked": {
                                                            "type": "integer"
                                                        },
                                                        "ok": {
                                                            "type": "integer"
                                                        },
                                                        "violations": {
                                                            "type": "integer"
                                                        },
                                                        "na": {
                                                            "type": "integer"
                                                        },
                                                        "critical": {
                                                            "type": "integer"
                                                        },
                                                        "repeats": {
                                                            "type": "integer"
                                                        },
                                                        "photos": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "previous": {
                                                    "type": "object",
                                                    "properties": {
                                                        "result": {
                                                            "type": "number"
                                                        },
                                                        "date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "delta": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "result": {
                                                                "type": "number"
                                                            },
                                                            "checked": {
                                                                "type": "integer"
                                                            },
                                                            "ok": {
                                                                "type": "integer"
                                                            },
                                                            "violations": {
                                                                "type": "integer"
                                                            },
                                                            "na": {
                                                                "type": "integer"
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "question_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "string"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "result": {
                                                                            "type": "string"
                                                                        },
                                                                        "answer": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "tier": {
                                                                            "type": "string"
                                                                        },
                                                                        "repeat": {
                                                                            "type": "integer"
                                                                        },
                                                                        "fail_all": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": "string"
                                                                        },
                                                                        "photos": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "url": {
                                                                                        "type": "string",
                                                                                        "format": "uri"
                                                                                    },
                                                                                    "name": {
                                                                                        "type": "string"
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "files": {
                                                                            "type": "array"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "violations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "question_id": {
                                                                "type": "integer"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "result": {
                                                                "type": "string"
                                                            },
                                                            "answer": {
                                                                "type": "string"
                                                            },
                                                            "weight": {
                                                                "type": "integer"
                                                            },
                                                            "tier": {
                                                                "type": "string"
                                                            },
                                                            "repeat": {
                                                                "type": "integer"
                                                            },
                                                            "fail_all": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": "string"
                                                            },
                                                            "photos": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "url": {
                                                                            "type": "string",
                                                                            "format": "uri"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            },
                                                            "section": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai": {
                                                    "type": "object",
                                                    "properties": {
                                                        "summary": {
                                                            "type": "string"
                                                        },
                                                        "verdict": {
                                                            "type": "string"
                                                        },
                                                        "recommendations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "plan": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "priority": {
                                                                        "type": "string"
                                                                    },
                                                                    "action": {
                                                                        "type": "string"
                                                                    },
                                                                    "owner": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "signature_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lon": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "tasks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "question_id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 99812,
                                        "uuid": "9a72f859-63a3-4046-9616-8aaf730073ff",
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "mystery": false,
                                        "status": "completed",
                                        "result": 82.4,
                                        "report_status": "ready",
                                        "conducted_at": "2026-11-03T09:40:00+05:00",
                                        "created_at": "2026-11-03T09:41:12+05:00",
                                        "report_url": "https://app.jecheck.io/api/reports/newVersionSavePdf/9a72f859-63a3-4046-9616-8aaf730073ff",
                                        "scoring": "points",
                                        "target": 85,
                                        "level": "warn",
                                        "failed_by": [],
                                        "counts": {
                                            "checked": 18,
                                            "ok": 15,
                                            "violations": 3,
                                            "na": 1,
                                            "critical": 1,
                                            "repeats": 1,
                                            "photos": 6
                                        },
                                        "previous": {
                                            "result": 76.5,
                                            "date": "2026-10-27",
                                            "delta": 5.9
                                        },
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "result": 71.4,
                                                "checked": 7,
                                                "ok": 5,
                                                "violations": 2,
                                                "na": 0,
                                                "questions": [
                                                    {
                                                        "question_id": 197426,
                                                        "number": "1.2",
                                                        "text": "Fridge temperature is within the norm",
                                                        "result": "violation",
                                                        "answer": "9.1 °C",
                                                        "weight": 5,
                                                        "tier": "critical",
                                                        "repeat": 2,
                                                        "fail_all": false,
                                                        "comment": "Door seal is torn",
                                                        "photos": [
                                                            {
                                                                "url": "https://jecheck.s3.eu-west-1.amazonaws.com/audits/761/fridge.jpg",
                                                                "name": "fridge.jpg"
                                                            }
                                                        ],
                                                        "files": []
                                                    }
                                                ]
                                            }
                                        ],
                                        "violations": [
                                            {
                                                "question_id": 197426,
                                                "number": "1.2",
                                                "text": "Fridge temperature is within the norm",
                                                "result": "violation",
                                                "answer": "9.1 °C",
                                                "weight": 5,
                                                "tier": "critical",
                                                "repeat": 2,
                                                "fail_all": false,
                                                "comment": "Door seal is torn",
                                                "photos": [
                                                    {
                                                        "url": "https://jecheck.s3.eu-west-1.amazonaws.com/audits/761/fridge.jpg",
                                                        "name": "fridge.jpg"
                                                    }
                                                ],
                                                "files": [],
                                                "section": "Kitchen"
                                            }
                                        ],
                                        "ai": {
                                            "summary": "Cold chain is the main risk: two fridges out of range.",
                                            "verdict": "Needs attention",
                                            "recommendations": [
                                                "Replace the door seal of fridge #2"
                                            ],
                                            "plan": [
                                                {
                                                    "priority": "high",
                                                    "action": "Replace the seal",
                                                    "owner": "Chef",
                                                    "section": "Kitchen"
                                                }
                                            ]
                                        },
                                        "signature_url": null,
                                        "geo": {
                                            "lat": 43.23811,
                                            "lon": 76.94572
                                        },
                                        "tasks": [
                                            {
                                                "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                                "title": "Replace the broken fridge seal",
                                                "status": "in_progress",
                                                "due_date": "2026-11-04",
                                                "question_id": 197426
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/audits/{id}": {
            "get": {
                "operationId": "auditsGet",
                "summary": "Retrieve an audit result",
                "description": "The result card, calculated exactly like the PDF report: score, target and `level` (`bad` — not passed, `warn` — passed below target, `ok` — target reached / excellent), sections with their results, every answered question (`result`: `ok`, `violation`, `na`, `info` for unscored answers) with comments and photos, violations sorted by weight and repetition, previous audit of the same checklist at the location, the AI report if enabled, and corrective tasks created from this audit. Own audits are always visible; others need `audits.view` on the location.",
                "tags": [
                    "Audits"
                ],
                "x-mcp-tool": "audits_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "mystery": {
                                                    "type": "boolean"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "result": {
                                                    "type": "number"
                                                },
                                                "report_status": {
                                                    "type": "string"
                                                },
                                                "conducted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "report_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "target": {
                                                    "type": "integer"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "failed_by": {
                                                    "type": "array"
                                                },
                                                "counts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "checked": {
                                                            "type": "integer"
                                                        },
                                                        "ok": {
                                                            "type": "integer"
                                                        },
                                                        "violations": {
                                                            "type": "integer"
                                                        },
                                                        "na": {
                                                            "type": "integer"
                                                        },
                                                        "critical": {
                                                            "type": "integer"
                                                        },
                                                        "repeats": {
                                                            "type": "integer"
                                                        },
                                                        "photos": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "previous": {
                                                    "type": "object",
                                                    "properties": {
                                                        "result": {
                                                            "type": "number"
                                                        },
                                                        "date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "delta": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "result": {
                                                                "type": "number"
                                                            },
                                                            "checked": {
                                                                "type": "integer"
                                                            },
                                                            "ok": {
                                                                "type": "integer"
                                                            },
                                                            "violations": {
                                                                "type": "integer"
                                                            },
                                                            "na": {
                                                                "type": "integer"
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "question_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "string"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "result": {
                                                                            "type": "string"
                                                                        },
                                                                        "answer": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "tier": {
                                                                            "type": "string"
                                                                        },
                                                                        "repeat": {
                                                                            "type": "integer"
                                                                        },
                                                                        "fail_all": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": "string"
                                                                        },
                                                                        "photos": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "url": {
                                                                                        "type": "string",
                                                                                        "format": "uri"
                                                                                    },
                                                                                    "name": {
                                                                                        "type": "string"
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "files": {
                                                                            "type": "array"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "violations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "question_id": {
                                                                "type": "integer"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "result": {
                                                                "type": "string"
                                                            },
                                                            "answer": {
                                                                "type": "string"
                                                            },
                                                            "weight": {
                                                                "type": "integer"
                                                            },
                                                            "tier": {
                                                                "type": "string"
                                                            },
                                                            "repeat": {
                                                                "type": "integer"
                                                            },
                                                            "fail_all": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": "string"
                                                            },
                                                            "photos": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "url": {
                                                                            "type": "string",
                                                                            "format": "uri"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            },
                                                            "section": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai": {
                                                    "type": "object",
                                                    "properties": {
                                                        "summary": {
                                                            "type": "string"
                                                        },
                                                        "verdict": {
                                                            "type": "string"
                                                        },
                                                        "recommendations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "plan": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "priority": {
                                                                        "type": "string"
                                                                    },
                                                                    "action": {
                                                                        "type": "string"
                                                                    },
                                                                    "owner": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "signature_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lon": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "tasks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "question_id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 99812,
                                        "uuid": "9a72f859-63a3-4046-9616-8aaf730073ff",
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "mystery": false,
                                        "status": "completed",
                                        "result": 82.4,
                                        "report_status": "ready",
                                        "conducted_at": "2026-11-03T09:40:00+05:00",
                                        "created_at": "2026-11-03T09:41:12+05:00",
                                        "report_url": "https://app.jecheck.io/api/reports/newVersionSavePdf/9a72f859-63a3-4046-9616-8aaf730073ff",
                                        "scoring": "points",
                                        "target": 85,
                                        "level": "warn",
                                        "failed_by": [],
                                        "counts": {
                                            "checked": 18,
                                            "ok": 15,
                                            "violations": 3,
                                            "na": 1,
                                            "critical": 1,
                                            "repeats": 1,
                                            "photos": 6
                                        },
                                        "previous": {
                                            "result": 76.5,
                                            "date": "2026-10-27",
                                            "delta": 5.9
                                        },
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "result": 71.4,
                                                "checked": 7,
                                                "ok": 5,
                                                "violations": 2,
                                                "na": 0,
                                                "questions": [
                                                    {
                                                        "question_id": 197426,
                                                        "number": "1.2",
                                                        "text": "Fridge temperature is within the norm",
                                                        "result": "violation",
                                                        "answer": "9.1 °C",
                                                        "weight": 5,
                                                        "tier": "critical",
                                                        "repeat": 2,
                                                        "fail_all": false,
                                                        "comment": "Door seal is torn",
                                                        "photos": [
                                                            {
                                                                "url": "https://jecheck.s3.eu-west-1.amazonaws.com/audits/761/fridge.jpg",
                                                                "name": "fridge.jpg"
                                                            }
                                                        ],
                                                        "files": []
                                                    }
                                                ]
                                            }
                                        ],
                                        "violations": [
                                            {
                                                "question_id": 197426,
                                                "number": "1.2",
                                                "text": "Fridge temperature is within the norm",
                                                "result": "violation",
                                                "answer": "9.1 °C",
                                                "weight": 5,
                                                "tier": "critical",
                                                "repeat": 2,
                                                "fail_all": false,
                                                "comment": "Door seal is torn",
                                                "photos": [
                                                    {
                                                        "url": "https://jecheck.s3.eu-west-1.amazonaws.com/audits/761/fridge.jpg",
                                                        "name": "fridge.jpg"
                                                    }
                                                ],
                                                "files": [],
                                                "section": "Kitchen"
                                            }
                                        ],
                                        "ai": {
                                            "summary": "Cold chain is the main risk: two fridges out of range.",
                                            "verdict": "Needs attention",
                                            "recommendations": [
                                                "Replace the door seal of fridge #2"
                                            ],
                                            "plan": [
                                                {
                                                    "priority": "high",
                                                    "action": "Replace the seal",
                                                    "owner": "Chef",
                                                    "section": "Kitchen"
                                                }
                                            ]
                                        },
                                        "signature_url": null,
                                        "geo": {
                                            "lat": 43.23811,
                                            "lon": 76.94572
                                        },
                                        "tasks": [
                                            {
                                                "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                                "title": "Replace the broken fridge seal",
                                                "status": "in_progress",
                                                "due_date": "2026-11-04",
                                                "question_id": 197426
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "auditsDelete",
                "summary": "Delete an audit",
                "description": "Permanently deletes the audit with its answers and attachments: it disappears from the journal, analytics and reports and cannot be restored. Corrective tasks created from it stay. Requires `audits.delete` on the audit location.",
                "tags": [
                    "Audits"
                ],
                "x-mcp-tool": "audits_delete",
                "x-permissions": [
                    "audits.delete"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/audits/{id}/pdf": {
            "get": {
                "operationId": "auditsPdf",
                "summary": "Get the PDF report link",
                "description": "Returns a public link to the PDF report (no login needed — share it carefully) and the online report link. `ready: false` — the PDF is still being generated, try again in a minute. Requires `audits.export` on the audit location; each call is recorded in the access log.",
                "tags": [
                    "Audits"
                ],
                "x-mcp-tool": "audits_pdf",
                "x-permissions": [
                    "audits.export"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "ready": {
                                                    "type": "boolean"
                                                },
                                                "pdf_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "online_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "ready": true,
                                        "pdf_url": "https://app.jecheck.io/api/reports/pdf/9a72f859-63a3-4046-9616-8aaf730073ff",
                                        "online_url": "https://app.jecheck.io/api/reports/newVersionSavePdf/9a72f859-63a3-4046-9616-8aaf730073ff"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/loop/{uuid}": {
            "get": {
                "operationId": "automationLoopGet",
                "summary": "Get the corrective-action loop of a task",
                "description": "For a task created from an audit violation: the audit, deadline, whether a photo \"after\" and confirmation are required, photos before/after, whether the acting user may accept it, AI verdict and the loop history.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_loop_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "audit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "checklist": {
                                                            "type": "string"
                                                        },
                                                        "score": {
                                                            "type": "integer"
                                                        },
                                                        "confirmed_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "deadline_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean"
                                                },
                                                "requires_confirmation": {
                                                    "type": "boolean"
                                                },
                                                "has_after_photo": {
                                                    "type": "boolean"
                                                },
                                                "can_confirm": {
                                                    "type": "boolean"
                                                },
                                                "is_repeat": {
                                                    "type": "boolean"
                                                },
                                                "reopen_count": {
                                                    "type": "integer"
                                                },
                                                "unassigned_role": {
                                                    "type": "boolean"
                                                },
                                                "seen_again": {
                                                    "type": "integer"
                                                },
                                                "before_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "after_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "ai_verdict": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "actor": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "string"
                                                            },
                                                            "payload": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "comment": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "status": "review",
                                        "source": "auto",
                                        "audit": {
                                            "id": 99812,
                                            "uuid": "0a9b8c7d-6e5f-4a3b-8c1d-2e3f4a5b6c7d",
                                            "checklist": "Kitchen daily check",
                                            "score": 82,
                                            "confirmed_at": "2026-11-03T09:40:00+05:00"
                                        },
                                        "deadline_at": "2026-11-03T13:40:00+05:00",
                                        "requires_photo": true,
                                        "requires_confirmation": true,
                                        "has_after_photo": true,
                                        "can_confirm": true,
                                        "is_repeat": false,
                                        "reopen_count": 0,
                                        "unassigned_role": false,
                                        "seen_again": 0,
                                        "before_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/audits/before.jpg"
                                        ],
                                        "after_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/tasks/images/0001/after.jpg"
                                        ],
                                        "ai_verdict": null,
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "label": "Submitted for review",
                                                "actor": "user",
                                                "user": "Aigerim",
                                                "payload": {
                                                    "comment": "Seal replaced"
                                                },
                                                "at": "2026-11-03T12:30:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/loop/{uuid}/confirm": {
            "post": {
                "operationId": "automationLoopConfirm",
                "summary": "Accept the fix",
                "description": "A confirmer (location manager, auditor or the one set by the scenario — see `can_confirm`) accepts the fix; the task is completed.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_loop_confirm",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "audit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "checklist": {
                                                            "type": "string"
                                                        },
                                                        "score": {
                                                            "type": "integer"
                                                        },
                                                        "confirmed_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "deadline_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean"
                                                },
                                                "requires_confirmation": {
                                                    "type": "boolean"
                                                },
                                                "has_after_photo": {
                                                    "type": "boolean"
                                                },
                                                "can_confirm": {
                                                    "type": "boolean"
                                                },
                                                "is_repeat": {
                                                    "type": "boolean"
                                                },
                                                "reopen_count": {
                                                    "type": "integer"
                                                },
                                                "unassigned_role": {
                                                    "type": "boolean"
                                                },
                                                "seen_again": {
                                                    "type": "integer"
                                                },
                                                "before_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "after_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "ai_verdict": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "actor": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "string"
                                                            },
                                                            "payload": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "comment": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "status": "review",
                                        "source": "auto",
                                        "audit": {
                                            "id": 99812,
                                            "uuid": "0a9b8c7d-6e5f-4a3b-8c1d-2e3f4a5b6c7d",
                                            "checklist": "Kitchen daily check",
                                            "score": 82,
                                            "confirmed_at": "2026-11-03T09:40:00+05:00"
                                        },
                                        "deadline_at": "2026-11-03T13:40:00+05:00",
                                        "requires_photo": true,
                                        "requires_confirmation": true,
                                        "has_after_photo": true,
                                        "can_confirm": true,
                                        "is_repeat": false,
                                        "reopen_count": 0,
                                        "unassigned_role": false,
                                        "seen_again": 0,
                                        "before_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/audits/before.jpg"
                                        ],
                                        "after_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/tasks/images/0001/after.jpg"
                                        ],
                                        "ai_verdict": null,
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "label": "Submitted for review",
                                                "actor": "user",
                                                "user": "Aigerim",
                                                "payload": {
                                                    "comment": "Seal replaced"
                                                },
                                                "at": "2026-11-03T12:30:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/loop/{uuid}/photo": {
            "post": {
                "operationId": "automationLoopPhoto",
                "summary": "Upload a photo \"after\"",
                "description": "Attaches a photo of the fixed violation (JPEG/PNG/HEIC…, up to 15 MB; resized to 1920 px). Required before `submit` when `requires_photo` is true.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_loop_photo",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "photo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Image file (multipart; in MCP — object with `name` and `content_base64`)"
                                    }
                                },
                                "required": [
                                    "photo"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "photo": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "Image file (multipart; in MCP — object with `name` and `content_base64`)"
                                    }
                                },
                                "required": [
                                    "photo"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "audit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "checklist": {
                                                            "type": "string"
                                                        },
                                                        "score": {
                                                            "type": "integer"
                                                        },
                                                        "confirmed_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "deadline_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean"
                                                },
                                                "requires_confirmation": {
                                                    "type": "boolean"
                                                },
                                                "has_after_photo": {
                                                    "type": "boolean"
                                                },
                                                "can_confirm": {
                                                    "type": "boolean"
                                                },
                                                "is_repeat": {
                                                    "type": "boolean"
                                                },
                                                "reopen_count": {
                                                    "type": "integer"
                                                },
                                                "unassigned_role": {
                                                    "type": "boolean"
                                                },
                                                "seen_again": {
                                                    "type": "integer"
                                                },
                                                "before_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "after_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "ai_verdict": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "actor": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "string"
                                                            },
                                                            "payload": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "comment": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "status": "review",
                                        "source": "auto",
                                        "audit": {
                                            "id": 99812,
                                            "uuid": "0a9b8c7d-6e5f-4a3b-8c1d-2e3f4a5b6c7d",
                                            "checklist": "Kitchen daily check",
                                            "score": 82,
                                            "confirmed_at": "2026-11-03T09:40:00+05:00"
                                        },
                                        "deadline_at": "2026-11-03T13:40:00+05:00",
                                        "requires_photo": true,
                                        "requires_confirmation": true,
                                        "has_after_photo": true,
                                        "can_confirm": true,
                                        "is_repeat": false,
                                        "reopen_count": 0,
                                        "unassigned_role": false,
                                        "seen_again": 0,
                                        "before_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/audits/before.jpg"
                                        ],
                                        "after_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/tasks/images/0001/after.jpg"
                                        ],
                                        "ai_verdict": null,
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "label": "Submitted for review",
                                                "actor": "user",
                                                "user": "Aigerim",
                                                "payload": {
                                                    "comment": "Seal replaced"
                                                },
                                                "at": "2026-11-03T12:30:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/loop/{uuid}/reject": {
            "post": {
                "operationId": "automationLoopReject",
                "summary": "Return the fix for rework",
                "description": "A confirmer returns the task to the executor with a reason; reminders restart.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_loop_reject",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 1000
                                    }
                                },
                                "required": [
                                    "reason"
                                ]
                            },
                            "example": {
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "audit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "checklist": {
                                                            "type": "string"
                                                        },
                                                        "score": {
                                                            "type": "integer"
                                                        },
                                                        "confirmed_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "deadline_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean"
                                                },
                                                "requires_confirmation": {
                                                    "type": "boolean"
                                                },
                                                "has_after_photo": {
                                                    "type": "boolean"
                                                },
                                                "can_confirm": {
                                                    "type": "boolean"
                                                },
                                                "is_repeat": {
                                                    "type": "boolean"
                                                },
                                                "reopen_count": {
                                                    "type": "integer"
                                                },
                                                "unassigned_role": {
                                                    "type": "boolean"
                                                },
                                                "seen_again": {
                                                    "type": "integer"
                                                },
                                                "before_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "after_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "ai_verdict": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "actor": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "string"
                                                            },
                                                            "payload": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "comment": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "status": "review",
                                        "source": "auto",
                                        "audit": {
                                            "id": 99812,
                                            "uuid": "0a9b8c7d-6e5f-4a3b-8c1d-2e3f4a5b6c7d",
                                            "checklist": "Kitchen daily check",
                                            "score": 82,
                                            "confirmed_at": "2026-11-03T09:40:00+05:00"
                                        },
                                        "deadline_at": "2026-11-03T13:40:00+05:00",
                                        "requires_photo": true,
                                        "requires_confirmation": true,
                                        "has_after_photo": true,
                                        "can_confirm": true,
                                        "is_repeat": false,
                                        "reopen_count": 0,
                                        "unassigned_role": false,
                                        "seen_again": 0,
                                        "before_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/audits/before.jpg"
                                        ],
                                        "after_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/tasks/images/0001/after.jpg"
                                        ],
                                        "ai_verdict": null,
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "label": "Submitted for review",
                                                "actor": "user",
                                                "user": "Aigerim",
                                                "payload": {
                                                    "comment": "Seal replaced"
                                                },
                                                "at": "2026-11-03T12:30:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/loop/{uuid}/submit": {
            "post": {
                "operationId": "automationLoopSubmit",
                "summary": "Mark the violation as fixed",
                "description": "The executor reports the fix: the task goes to review (if confirmation is required) or is completed. A queued team task becomes the acting user's.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_loop_submit",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "comment": {
                                        "type": "string",
                                        "maxLength": 500
                                    }
                                }
                            },
                            "example": {
                                "comment": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "audit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "checklist": {
                                                            "type": "string"
                                                        },
                                                        "score": {
                                                            "type": "integer"
                                                        },
                                                        "confirmed_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "deadline_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean"
                                                },
                                                "requires_confirmation": {
                                                    "type": "boolean"
                                                },
                                                "has_after_photo": {
                                                    "type": "boolean"
                                                },
                                                "can_confirm": {
                                                    "type": "boolean"
                                                },
                                                "is_repeat": {
                                                    "type": "boolean"
                                                },
                                                "reopen_count": {
                                                    "type": "integer"
                                                },
                                                "unassigned_role": {
                                                    "type": "boolean"
                                                },
                                                "seen_again": {
                                                    "type": "integer"
                                                },
                                                "before_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "after_photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                },
                                                "ai_verdict": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "actor": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "string"
                                                            },
                                                            "payload": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "comment": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "status": "review",
                                        "source": "auto",
                                        "audit": {
                                            "id": 99812,
                                            "uuid": "0a9b8c7d-6e5f-4a3b-8c1d-2e3f4a5b6c7d",
                                            "checklist": "Kitchen daily check",
                                            "score": 82,
                                            "confirmed_at": "2026-11-03T09:40:00+05:00"
                                        },
                                        "deadline_at": "2026-11-03T13:40:00+05:00",
                                        "requires_photo": true,
                                        "requires_confirmation": true,
                                        "has_after_photo": true,
                                        "can_confirm": true,
                                        "is_repeat": false,
                                        "reopen_count": 0,
                                        "unassigned_role": false,
                                        "seen_again": 0,
                                        "before_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/audits/before.jpg"
                                        ],
                                        "after_photos": [
                                            "https://bucket.s3.eu-central-1.amazonaws.com/tasks/images/0001/after.jpg"
                                        ],
                                        "ai_verdict": null,
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "label": "Submitted for review",
                                                "actor": "user",
                                                "user": "Aigerim",
                                                "payload": {
                                                    "comment": "Seal replaced"
                                                },
                                                "at": "2026-11-03T12:30:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/presets": {
            "get": {
                "operationId": "automationPresets",
                "summary": "List scenario templates",
                "description": "Ready-made scenarios with complete definitions, plus the catalog of block types the editor supports.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_presets",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "presets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "definition": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "steps": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "field": {
                                                                                    "type": "string"
                                                                                },
                                                                                "op": {
                                                                                    "type": "string"
                                                                                },
                                                                                "value": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "then": {
                                                                                    "type": "array",
                                                                                    "items": {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                            "type": {
                                                                                                "type": "string"
                                                                                            },
                                                                                            "hours": {
                                                                                                "type": "integer"
                                                                                            },
                                                                                            "by": {
                                                                                                "type": "string"
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                },
                                                                                "else": {
                                                                                    "type": "array",
                                                                                    "items": {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                            "type": {
                                                                                                "type": "string"
                                                                                            },
                                                                                            "hours": {
                                                                                                "type": "integer"
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "actions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "condition_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "assign_to": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "escalate_to": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "presets": [
                                            {
                                                "key": "standard",
                                                "name": "Standard",
                                                "description": "Critical — 4 hours, photo and confirmation; others — 24 hours and photo.",
                                                "definition": {
                                                    "v": 1,
                                                    "steps": [
                                                        {
                                                            "type": "assign",
                                                            "to": "responsible_role"
                                                        },
                                                        {
                                                            "type": "condition",
                                                            "field": "weight",
                                                            "op": "gte",
                                                            "value": 3,
                                                            "then": [
                                                                {
                                                                    "type": "deadline",
                                                                    "hours": 4
                                                                },
                                                                {
                                                                    "type": "require_photo"
                                                                },
                                                                {
                                                                    "type": "require_confirmation",
                                                                    "by": "managers"
                                                                }
                                                            ],
                                                            "else": [
                                                                {
                                                                    "type": "deadline",
                                                                    "hours": 24
                                                                },
                                                                {
                                                                    "type": "require_photo"
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            }
                                        ],
                                        "actions": [
                                            "assign",
                                            "deadline",
                                            "require_photo",
                                            "require_confirmation",
                                            "remind",
                                            "escalate",
                                            "group",
                                            "ai_text",
                                            "ai_verify",
                                            "digest",
                                            "skip"
                                        ],
                                        "condition_fields": [
                                            "weight",
                                            "section",
                                            "checklist_question",
                                            "department",
                                            "is_repeat",
                                            "audit_score"
                                        ],
                                        "assign_to": [
                                            "responsible_role",
                                            "role",
                                            "managers",
                                            "auditor",
                                            "user",
                                            "team"
                                        ],
                                        "escalate_to": [
                                            "managers",
                                            "role",
                                            "user",
                                            "admins"
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/preview": {
            "post": {
                "operationId": "automationPreview",
                "summary": "Preview a scenario on an audit",
                "description": "Dry run: what the (possibly unsaved) definition would do with each violation of a completed audit — no tasks are created.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_preview",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-plan-feature": "automation",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "audit_id": {
                                        "type": "integer",
                                        "description": "Completed audit id"
                                    },
                                    "definition": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true
                                    }
                                },
                                "required": [
                                    "audit_id",
                                    "definition"
                                ]
                            },
                            "example": {
                                "audit_id": 42,
                                "definition": []
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "action": {
                                                                "type": "string"
                                                            },
                                                            "assign": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "to": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "deadline_hours": {
                                                                "type": "integer"
                                                            },
                                                            "require_photo": {
                                                                "type": "boolean"
                                                            },
                                                            "require_confirmation": {
                                                                "type": "string"
                                                            },
                                                            "question": {
                                                                "type": "string"
                                                            },
                                                            "section": {
                                                                "type": "string"
                                                            },
                                                            "weight": {
                                                                "type": "integer"
                                                            },
                                                            "assignees": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "fallback": {
                                                                "type": "boolean"
                                                            },
                                                            "is_repeat": {
                                                                "type": "boolean"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "errors": [],
                                        "items": [
                                            {
                                                "action": "task",
                                                "assign": {
                                                    "to": "responsible_role"
                                                },
                                                "deadline_hours": 4,
                                                "require_photo": true,
                                                "require_confirmation": "managers",
                                                "question": "Fridge temperature is within norm",
                                                "section": "Kitchen",
                                                "weight": 3,
                                                "assignees": [
                                                    "Aigerim"
                                                ],
                                                "fallback": false,
                                                "is_repeat": false,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/scenarios": {
            "get": {
                "operationId": "automationScenariosList",
                "summary": "List automation scenarios",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_scenarios_list",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "is_default": {
                                                        "type": "boolean"
                                                    },
                                                    "definition": {
                                                        "type": "object",
                                                        "properties": {
                                                            "v": {
                                                                "type": "integer"
                                                            },
                                                            "steps": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "to": {
                                                                            "type": "string"
                                                                        },
                                                                        "field": {
                                                                            "type": "string"
                                                                        },
                                                                        "op": {
                                                                            "type": "string"
                                                                        },
                                                                        "value": {
                                                                            "type": "integer"
                                                                        },
                                                                        "then": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "type": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "hours": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "by": {
                                                                                        "type": "string"
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "else": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "type": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "hours": {
                                                                                        "type": "integer"
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "checklists": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 5,
                                            "name": "Standard",
                                            "is_default": true,
                                            "definition": {
                                                "v": 1,
                                                "steps": [
                                                    {
                                                        "type": "assign",
                                                        "to": "responsible_role"
                                                    },
                                                    {
                                                        "type": "condition",
                                                        "field": "weight",
                                                        "op": "gte",
                                                        "value": 3,
                                                        "then": [
                                                            {
                                                                "type": "deadline",
                                                                "hours": 4
                                                            },
                                                            {
                                                                "type": "require_photo"
                                                            },
                                                            {
                                                                "type": "require_confirmation",
                                                                "by": "managers"
                                                            }
                                                        ],
                                                        "else": [
                                                            {
                                                                "type": "deadline",
                                                                "hours": 24
                                                            },
                                                            {
                                                                "type": "require_photo"
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            "checklists": [
                                                {
                                                    "id": 101,
                                                    "name": "Kitchen daily check"
                                                }
                                            ],
                                            "created_at": "2026-09-01T10:00:00+05:00",
                                            "updated_at": "2026-10-20T09:00:00+05:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "automationScenariosCreate",
                "summary": "Create a scenario",
                "description": "The definition is validated by the same engine as in the web editor; errors come back as `validation_failed` on `definition`.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_scenarios_create",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-plan-feature": "automation",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Scenario name",
                                        "maxLength": 255
                                    },
                                    "definition": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Block tree {\"steps\": [...]}. Action blocks: assign, deadline, require_photo, require_confirmation, remind, escalate, group, ai_text, ai_verify, digest, skip; `condition` blocks on weight, section, checklist_question, department, is_repeat, audit_score with `then` / `else` branches; assign targets: responsible_role, role, managers, auditor, user, team. See `automation.presets` for complete examples"
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Use for checklists without their own scenario"
                                    },
                                    "checklist_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Checklists that use this scenario (replaces the list)"
                                    }
                                },
                                "required": [
                                    "name",
                                    "definition"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "definition": [],
                                "is_default": true,
                                "checklist_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "definition": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "to": {
                                                                        "type": "string"
                                                                    },
                                                                    "field": {
                                                                        "type": "string"
                                                                    },
                                                                    "op": {
                                                                        "type": "string"
                                                                    },
                                                                    "value": {
                                                                        "type": "integer"
                                                                    },
                                                                    "then": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "hours": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "by": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        }
                                                                    },
                                                                    "else": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Standard",
                                        "is_default": true,
                                        "definition": {
                                            "v": 1,
                                            "steps": [
                                                {
                                                    "type": "assign",
                                                    "to": "responsible_role"
                                                },
                                                {
                                                    "type": "condition",
                                                    "field": "weight",
                                                    "op": "gte",
                                                    "value": 3,
                                                    "then": [
                                                        {
                                                            "type": "deadline",
                                                            "hours": 4
                                                        },
                                                        {
                                                            "type": "require_photo"
                                                        },
                                                        {
                                                            "type": "require_confirmation",
                                                            "by": "managers"
                                                        }
                                                    ],
                                                    "else": [
                                                        {
                                                            "type": "deadline",
                                                            "hours": 24
                                                        },
                                                        {
                                                            "type": "require_photo"
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "checklists": [
                                            {
                                                "id": 101,
                                                "name": "Kitchen daily check"
                                            }
                                        ],
                                        "created_at": "2026-09-01T10:00:00+05:00",
                                        "updated_at": "2026-10-20T09:00:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/automation/scenarios/{id}": {
            "get": {
                "operationId": "automationScenariosGet",
                "summary": "Retrieve a scenario",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_scenarios_get",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Scenario id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "definition": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "to": {
                                                                        "type": "string"
                                                                    },
                                                                    "field": {
                                                                        "type": "string"
                                                                    },
                                                                    "op": {
                                                                        "type": "string"
                                                                    },
                                                                    "value": {
                                                                        "type": "integer"
                                                                    },
                                                                    "then": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "hours": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "by": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        }
                                                                    },
                                                                    "else": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Standard",
                                        "is_default": true,
                                        "definition": {
                                            "v": 1,
                                            "steps": [
                                                {
                                                    "type": "assign",
                                                    "to": "responsible_role"
                                                },
                                                {
                                                    "type": "condition",
                                                    "field": "weight",
                                                    "op": "gte",
                                                    "value": 3,
                                                    "then": [
                                                        {
                                                            "type": "deadline",
                                                            "hours": 4
                                                        },
                                                        {
                                                            "type": "require_photo"
                                                        },
                                                        {
                                                            "type": "require_confirmation",
                                                            "by": "managers"
                                                        }
                                                    ],
                                                    "else": [
                                                        {
                                                            "type": "deadline",
                                                            "hours": 24
                                                        },
                                                        {
                                                            "type": "require_photo"
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "checklists": [
                                            {
                                                "id": 101,
                                                "name": "Kitchen daily check"
                                            }
                                        ],
                                        "created_at": "2026-09-01T10:00:00+05:00",
                                        "updated_at": "2026-10-20T09:00:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "automationScenariosUpdate",
                "summary": "Update a scenario",
                "description": "Partial update; `definition` replaces the whole block tree.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_scenarios_update",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-plan-feature": "automation",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Scenario id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Scenario name",
                                        "maxLength": 255
                                    },
                                    "definition": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Block tree {\"steps\": [...]}. Action blocks: assign, deadline, require_photo, require_confirmation, remind, escalate, group, ai_text, ai_verify, digest, skip; `condition` blocks on weight, section, checklist_question, department, is_repeat, audit_score with `then` / `else` branches; assign targets: responsible_role, role, managers, auditor, user, team. See `automation.presets` for complete examples"
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Use for checklists without their own scenario"
                                    },
                                    "checklist_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Checklists that use this scenario (replaces the list)"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "definition": [],
                                "is_default": true,
                                "checklist_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "definition": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "to": {
                                                                        "type": "string"
                                                                    },
                                                                    "field": {
                                                                        "type": "string"
                                                                    },
                                                                    "op": {
                                                                        "type": "string"
                                                                    },
                                                                    "value": {
                                                                        "type": "integer"
                                                                    },
                                                                    "then": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "hours": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "by": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        }
                                                                    },
                                                                    "else": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5,
                                        "name": "Standard",
                                        "is_default": true,
                                        "definition": {
                                            "v": 1,
                                            "steps": [
                                                {
                                                    "type": "assign",
                                                    "to": "responsible_role"
                                                },
                                                {
                                                    "type": "condition",
                                                    "field": "weight",
                                                    "op": "gte",
                                                    "value": 3,
                                                    "then": [
                                                        {
                                                            "type": "deadline",
                                                            "hours": 4
                                                        },
                                                        {
                                                            "type": "require_photo"
                                                        },
                                                        {
                                                            "type": "require_confirmation",
                                                            "by": "managers"
                                                        }
                                                    ],
                                                    "else": [
                                                        {
                                                            "type": "deadline",
                                                            "hours": 24
                                                        },
                                                        {
                                                            "type": "require_photo"
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "checklists": [
                                            {
                                                "id": 101,
                                                "name": "Kitchen daily check"
                                            }
                                        ],
                                        "created_at": "2026-09-01T10:00:00+05:00",
                                        "updated_at": "2026-10-20T09:00:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "automationScenariosDelete",
                "summary": "Delete a scenario",
                "description": "Checklists that used it fall back to the default scenario.",
                "tags": [
                    "Automation"
                ],
                "x-mcp-tool": "automation_scenarios_delete",
                "x-permissions": [
                    "automation.manage"
                ],
                "x-plan-feature": "automation",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Scenario id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists": {
            "get": {
                "operationId": "checklistsList",
                "summary": "List checklists",
                "description": "Checklists of the company, recently changed first, with structure size and usage over the last 30 days. Without `checklists.edit` only checklists available to the token user are returned (see \"who can run\" in the checklist). Deleted checklists (trash, last 30 days) — with `deleted=true` and the `checklists.delete` permission.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_list",
                "x-permissions": [
                    "checklists.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "folder_id",
                        "in": "query",
                        "description": "Only checklists of this folder; `0` — checklists without a folder",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search in name and description",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only checklists changed after this moment — use for incremental sync",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "deleted",
                        "in": "query",
                        "description": "Return deleted checklists (trash) instead of active ones; requires `checklists.delete`",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "folder": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "scoring": {
                                                        "type": "string"
                                                    },
                                                    "sections_count": {
                                                        "type": "integer"
                                                    },
                                                    "questions_count": {
                                                        "type": "integer"
                                                    },
                                                    "author": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "audits_30d": {
                                                        "type": "integer"
                                                    },
                                                    "avg_result_30d": {
                                                        "type": "number"
                                                    },
                                                    "last_audit_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "restricted": {
                                                        "type": "boolean"
                                                    },
                                                    "ai_summary": {
                                                        "type": "boolean"
                                                    },
                                                    "require_location": {
                                                        "type": "boolean"
                                                    },
                                                    "require_signature": {
                                                        "type": "boolean"
                                                    },
                                                    "deleted": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 5845,
                                            "name": "Daily dining room check",
                                            "description": "Opening check of the hall, restrooms and staff",
                                            "folder": {
                                                "id": 31,
                                                "name": "Front of house"
                                            },
                                            "scoring": "points",
                                            "sections_count": 4,
                                            "questions_count": 18,
                                            "author": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "audits_30d": 12,
                                            "avg_result_30d": 81.4,
                                            "last_audit_at": "2026-11-02T18:40:00+05:00",
                                            "restricted": true,
                                            "ai_summary": false,
                                            "require_location": true,
                                            "require_signature": false,
                                            "deleted": false,
                                            "created_at": "2026-03-14T09:10:00+05:00",
                                            "updated_at": "2026-10-28T16:22:00+05:00",
                                            "url": "https://app.jecheck.io/ui/checklists/5845/edit"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "checklistsCreate",
                "summary": "Create a checklist",
                "description": "Creates a checklist with sections and questions in one call. Minimal question: `{\"text\": \"Floors are clean\"}` — a yes/no question with weight 1. Display conditions (`settings.show_if`) reference question ids, so add them later with `checklists.structure.update`.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_create",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Checklist name (at least 5 characters)",
                                        "minLength": 5,
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Description",
                                        "maxLength": 5000
                                    },
                                    "folder_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Folder id (see `checklists.folders.list`)"
                                    },
                                    "scoring": {
                                        "type": "string",
                                        "enum": [
                                            "points",
                                            "percent"
                                        ],
                                        "default": "points",
                                        "description": "`points` — weighted score (default), `percent` — share of compliant answers"
                                    },
                                    "sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "name": {
                                                    "type": "string",
                                                    "description": "Section name",
                                                    "minLength": 2,
                                                    "maxLength": 512
                                                },
                                                "questions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "text": {
                                                                "type": "string",
                                                                "description": "Question wording (at least 5 characters)",
                                                                "minLength": 5,
                                                                "maxLength": 2000
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "description": "Hint for the auditor",
                                                                "maxLength": 5000
                                                            },
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "yes_no",
                                                                    "text",
                                                                    "choice",
                                                                    "multi",
                                                                    "number",
                                                                    "scale",
                                                                    "date",
                                                                    "signature",
                                                                    "photo",
                                                                    "instruction",
                                                                    "barcode",
                                                                    "employee"
                                                                ],
                                                                "default": "yes_no",
                                                                "description": "Answer type. `yes_no` (default) — complies / violation / not applicable; `choice`/`multi` need `settings.options`; `number` may have a norm `settings.min`/`max`; see the Checklists guide"
                                                            },
                                                            "weight": {
                                                                "type": "integer",
                                                                "default": 1,
                                                                "description": "Weight (points) of the question, 1–100",
                                                                "minimum": 1,
                                                                "maximum": 100
                                                            },
                                                            "photo_required": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "The auditor must attach a photo"
                                                            },
                                                            "can_skip": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "The question may be skipped"
                                                            },
                                                            "fail_all": {
                                                                "type": "boolean",
                                                                "description": "A violation on this question sets the whole audit result to 0 (scored types only)"
                                                            },
                                                            "settings": {
                                                                "type": [
                                                                    "object",
                                                                    "null"
                                                                ],
                                                                "properties": {},
                                                                "additionalProperties": true,
                                                                "description": "Type settings, e.g. `{\"options\":[{\"id\":\"a1\",\"label\":\"Clean\",\"result\":1,\"score\":1},{\"id\":\"a2\",\"label\":\"Dirty\",\"result\":2,\"score\":0}]}` for `choice`, `{\"unit\":\"°C\",\"min\":2,\"max\":6}` for `number`, `{\"min\":1,\"max\":5,\"pass\":4}` for `scale`; common keys `fail_all`, `show_if`, `media`"
                                                            }
                                                        },
                                                        "required": [
                                                            "text"
                                                        ]
                                                    },
                                                    "description": "Questions of the section, in order"
                                                }
                                            },
                                            "required": [
                                                "name",
                                                "questions"
                                            ]
                                        },
                                        "description": "Sections with questions, in order",
                                        "maxItems": 60
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "folder_id": 42,
                                "scoring": "points"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "sections_count": {
                                                    "type": "integer"
                                                },
                                                "questions_count": {
                                                    "type": "integer"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "audits_30d": {
                                                    "type": "integer"
                                                },
                                                "avg_result_30d": {
                                                    "type": "number"
                                                },
                                                "last_audit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "ai_summary": {
                                                    "type": "boolean"
                                                },
                                                "require_location": {
                                                    "type": "boolean"
                                                },
                                                "require_signature": {
                                                    "type": "boolean"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "available_from": {
                                                    "type": "string"
                                                },
                                                "available_to": {
                                                    "type": "string"
                                                },
                                                "select_manager": {
                                                    "type": "boolean"
                                                },
                                                "send_to_location": {
                                                    "type": "boolean"
                                                },
                                                "scenario_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "access": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "responsible": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "integer"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo_required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "settings": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "unit": {
                                                                                    "type": "string"
                                                                                },
                                                                                "min": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "max": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "decimals": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "fail_all": {
                                                                                    "type": "boolean"
                                                                                }
                                                                            }
                                                                        },
                                                                        "responsible": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "position_id": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        },
                                                                        "auto_task": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "enabled": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "deadline_hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5845,
                                        "name": "Daily dining room check",
                                        "description": "Opening check of the hall, restrooms and staff",
                                        "folder": {
                                            "id": 31,
                                            "name": "Front of house"
                                        },
                                        "scoring": "points",
                                        "sections_count": 4,
                                        "questions_count": 18,
                                        "author": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "audits_30d": 12,
                                        "avg_result_30d": 81.4,
                                        "last_audit_at": "2026-11-02T18:40:00+05:00",
                                        "restricted": true,
                                        "ai_summary": false,
                                        "require_location": true,
                                        "require_signature": false,
                                        "deleted": false,
                                        "created_at": "2026-03-14T09:10:00+05:00",
                                        "updated_at": "2026-10-28T16:22:00+05:00",
                                        "url": "https://app.jecheck.io/ui/checklists/5845/edit",
                                        "available_from": "00:01",
                                        "available_to": "23:59",
                                        "select_manager": false,
                                        "send_to_location": false,
                                        "scenario_id": null,
                                        "access": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "department",
                                                "id": 12
                                            }
                                        ],
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "responsible": null,
                                                "questions": [
                                                    {
                                                        "id": 197426,
                                                        "number": 1,
                                                        "text": "Fridge temperature is within the norm",
                                                        "description": "Check the display of fridge #2",
                                                        "type": "number",
                                                        "weight": 5,
                                                        "can_skip": false,
                                                        "photo_required": true,
                                                        "settings": {
                                                            "unit": "°C",
                                                            "min": 2,
                                                            "max": 6,
                                                            "decimals": 1,
                                                            "fail_all": true
                                                        },
                                                        "responsible": {
                                                            "to": "role",
                                                            "position_id": 14
                                                        },
                                                        "auto_task": {
                                                            "enabled": true,
                                                            "deadline_hours": 24
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/folders": {
            "get": {
                "operationId": "checklistsFoldersList",
                "summary": "List checklist folders",
                "description": "Folders are flat and shared with the mobile app.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_folders_list",
                "x-permissions": [
                    "checklists.view"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "checklists_count": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 31,
                                            "name": "Front of house",
                                            "color": "blue",
                                            "checklists_count": 7
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "checklistsFoldersCreate",
                "summary": "Create a checklist folder",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_folders_create",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Folder name, unique in the company",
                                        "minLength": 1,
                                        "maxLength": 100
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "blue",
                                            "green",
                                            "amber",
                                            "red",
                                            "violet",
                                            "teal",
                                            "gray"
                                        ],
                                        "description": "Color label"
                                    },
                                    "checklist_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Checklists to move into the new folder",
                                        "maxItems": 500
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "color": "blue",
                                "checklist_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "checklists_count": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Front of house",
                                        "color": "blue",
                                        "checklists_count": 7
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/folders/{id}": {
            "patch": {
                "operationId": "checklistsFoldersUpdate",
                "summary": "Rename or recolor a checklist folder",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_folders_update",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Folder id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name",
                                        "minLength": 1,
                                        "maxLength": 100
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "blue",
                                            "green",
                                            "amber",
                                            "red",
                                            "violet",
                                            "teal",
                                            "gray"
                                        ],
                                        "description": "Color label"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "color": "blue"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "checklists_count": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 31,
                                        "name": "Front of house",
                                        "color": "blue",
                                        "checklists_count": 7
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "checklistsFoldersDelete",
                "summary": "Delete a checklist folder",
                "description": "Deletes the folder; its checklists are not deleted and move to \"no folder\".",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_folders_delete",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Folder id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/move": {
            "post": {
                "operationId": "checklistsMove",
                "summary": "Move checklists to a folder",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_move",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Checklist ids",
                                        "minItems": 1,
                                        "maxItems": 500
                                    },
                                    "folder_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Target folder id; `null` — no folder"
                                    }
                                },
                                "required": [
                                    "ids",
                                    "folder_id"
                                ]
                            },
                            "example": {
                                "ids": [
                                    12,
                                    14
                                ],
                                "folder_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "moved": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "moved": 3
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}": {
            "get": {
                "operationId": "checklistsGet",
                "summary": "Retrieve a checklist with its structure",
                "description": "Settings, who may run it (`access`; empty — everyone) and the full structure: sections in order, questions with answer type, weight, photo requirement, type settings (options, norms, `show_if` display conditions, `fail_all`), responsible for fixing violations and auto-task settings. `scoring`: `points` — result is the share of earned weight, `percent` — share of compliant answers.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_get",
                "x-permissions": [
                    "checklists.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "sections_count": {
                                                    "type": "integer"
                                                },
                                                "questions_count": {
                                                    "type": "integer"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "audits_30d": {
                                                    "type": "integer"
                                                },
                                                "avg_result_30d": {
                                                    "type": "number"
                                                },
                                                "last_audit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "ai_summary": {
                                                    "type": "boolean"
                                                },
                                                "require_location": {
                                                    "type": "boolean"
                                                },
                                                "require_signature": {
                                                    "type": "boolean"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "available_from": {
                                                    "type": "string"
                                                },
                                                "available_to": {
                                                    "type": "string"
                                                },
                                                "select_manager": {
                                                    "type": "boolean"
                                                },
                                                "send_to_location": {
                                                    "type": "boolean"
                                                },
                                                "scenario_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "access": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "responsible": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "integer"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo_required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "settings": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "unit": {
                                                                                    "type": "string"
                                                                                },
                                                                                "min": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "max": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "decimals": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "fail_all": {
                                                                                    "type": "boolean"
                                                                                }
                                                                            }
                                                                        },
                                                                        "responsible": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "position_id": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        },
                                                                        "auto_task": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "enabled": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "deadline_hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5845,
                                        "name": "Daily dining room check",
                                        "description": "Opening check of the hall, restrooms and staff",
                                        "folder": {
                                            "id": 31,
                                            "name": "Front of house"
                                        },
                                        "scoring": "points",
                                        "sections_count": 4,
                                        "questions_count": 18,
                                        "author": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "audits_30d": 12,
                                        "avg_result_30d": 81.4,
                                        "last_audit_at": "2026-11-02T18:40:00+05:00",
                                        "restricted": true,
                                        "ai_summary": false,
                                        "require_location": true,
                                        "require_signature": false,
                                        "deleted": false,
                                        "created_at": "2026-03-14T09:10:00+05:00",
                                        "updated_at": "2026-10-28T16:22:00+05:00",
                                        "url": "https://app.jecheck.io/ui/checklists/5845/edit",
                                        "available_from": "00:01",
                                        "available_to": "23:59",
                                        "select_manager": false,
                                        "send_to_location": false,
                                        "scenario_id": null,
                                        "access": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "department",
                                                "id": 12
                                            }
                                        ],
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "responsible": null,
                                                "questions": [
                                                    {
                                                        "id": 197426,
                                                        "number": 1,
                                                        "text": "Fridge temperature is within the norm",
                                                        "description": "Check the display of fridge #2",
                                                        "type": "number",
                                                        "weight": 5,
                                                        "can_skip": false,
                                                        "photo_required": true,
                                                        "settings": {
                                                            "unit": "°C",
                                                            "min": 2,
                                                            "max": 6,
                                                            "decimals": 1,
                                                            "fail_all": true
                                                        },
                                                        "responsible": {
                                                            "to": "role",
                                                            "position_id": 14
                                                        },
                                                        "auto_task": {
                                                            "enabled": true,
                                                            "deadline_hours": 24
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "checklistsUpdate",
                "summary": "Update checklist settings",
                "description": "Partial update of the checklist settings: send only the fields to change. The structure is changed with `checklists.structure.update`. `ai_summary` (AI report on each audit) requires the AI feature of the plan.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_update",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name",
                                        "minLength": 5,
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Description",
                                        "maxLength": 5000
                                    },
                                    "folder_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Folder id; `null` — no folder"
                                    },
                                    "scoring": {
                                        "type": "string",
                                        "enum": [
                                            "points",
                                            "percent"
                                        ],
                                        "description": "Scoring mode"
                                    },
                                    "ai_summary": {
                                        "type": "boolean",
                                        "description": "Generate an AI report for each audit"
                                    },
                                    "require_location": {
                                        "type": "boolean",
                                        "description": "The app records the auditor geolocation"
                                    },
                                    "require_signature": {
                                        "type": "boolean",
                                        "description": "The audit must be signed"
                                    },
                                    "select_manager": {
                                        "type": "boolean",
                                        "description": "The auditor picks the location manager at the end of the audit"
                                    },
                                    "send_to_location": {
                                        "type": "boolean",
                                        "description": "Send the report to the location managers"
                                    },
                                    "available_from": {
                                        "type": "string",
                                        "description": "The checklist can be started from this time of day, `HH:MM`"
                                    },
                                    "available_to": {
                                        "type": "string",
                                        "description": "…and until this time of day, `HH:MM`"
                                    },
                                    "scenario_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Automation scenario for violations; `null` — the company default"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "folder_id": 42,
                                "scoring": "points"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "sections_count": {
                                                    "type": "integer"
                                                },
                                                "questions_count": {
                                                    "type": "integer"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "audits_30d": {
                                                    "type": "integer"
                                                },
                                                "avg_result_30d": {
                                                    "type": "number"
                                                },
                                                "last_audit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "ai_summary": {
                                                    "type": "boolean"
                                                },
                                                "require_location": {
                                                    "type": "boolean"
                                                },
                                                "require_signature": {
                                                    "type": "boolean"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "available_from": {
                                                    "type": "string"
                                                },
                                                "available_to": {
                                                    "type": "string"
                                                },
                                                "select_manager": {
                                                    "type": "boolean"
                                                },
                                                "send_to_location": {
                                                    "type": "boolean"
                                                },
                                                "scenario_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "access": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "responsible": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "integer"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo_required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "settings": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "unit": {
                                                                                    "type": "string"
                                                                                },
                                                                                "min": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "max": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "decimals": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "fail_all": {
                                                                                    "type": "boolean"
                                                                                }
                                                                            }
                                                                        },
                                                                        "responsible": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "position_id": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        },
                                                                        "auto_task": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "enabled": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "deadline_hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5845,
                                        "name": "Daily dining room check",
                                        "description": "Opening check of the hall, restrooms and staff",
                                        "folder": {
                                            "id": 31,
                                            "name": "Front of house"
                                        },
                                        "scoring": "points",
                                        "sections_count": 4,
                                        "questions_count": 18,
                                        "author": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "audits_30d": 12,
                                        "avg_result_30d": 81.4,
                                        "last_audit_at": "2026-11-02T18:40:00+05:00",
                                        "restricted": true,
                                        "ai_summary": false,
                                        "require_location": true,
                                        "require_signature": false,
                                        "deleted": false,
                                        "created_at": "2026-03-14T09:10:00+05:00",
                                        "updated_at": "2026-10-28T16:22:00+05:00",
                                        "url": "https://app.jecheck.io/ui/checklists/5845/edit",
                                        "available_from": "00:01",
                                        "available_to": "23:59",
                                        "select_manager": false,
                                        "send_to_location": false,
                                        "scenario_id": null,
                                        "access": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "department",
                                                "id": 12
                                            }
                                        ],
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "responsible": null,
                                                "questions": [
                                                    {
                                                        "id": 197426,
                                                        "number": 1,
                                                        "text": "Fridge temperature is within the norm",
                                                        "description": "Check the display of fridge #2",
                                                        "type": "number",
                                                        "weight": 5,
                                                        "can_skip": false,
                                                        "photo_required": true,
                                                        "settings": {
                                                            "unit": "°C",
                                                            "min": 2,
                                                            "max": 6,
                                                            "decimals": 1,
                                                            "fail_all": true
                                                        },
                                                        "responsible": {
                                                            "to": "role",
                                                            "position_id": 14
                                                        },
                                                        "auto_task": {
                                                            "enabled": true,
                                                            "deadline_hours": 24
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "checklistsDelete",
                "summary": "Delete a checklist",
                "description": "Moves the checklist to the trash for 30 days (restore with `checklists.restore`). Audits already conducted stay in the journal and analytics.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_delete",
                "x-permissions": [
                    "checklists.delete"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}/access": {
            "get": {
                "operationId": "checklistsAccessGet",
                "summary": "Get who can run a checklist",
                "description": "Rules of \"who can run\" the checklist in the mobile app: employees (`user`), positions (`position`), locations (`department`) and teams (`team`). An empty list means everyone; administrators can always run any checklist.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_access_get",
                "x-permissions": [
                    "checklists.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "rules": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "rules": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "user",
                                                "id": 311
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "checklistsAccessSet",
                "summary": "Set who can run a checklist",
                "description": "Replaces the access rules. Subjects of another company are ignored. An empty `rules` list makes the checklist available to everyone. The planner only lets you assign audits of a checklist to people who can run it.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_access_set",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "rules": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "department",
                                                        "team"
                                                    ],
                                                    "description": "Subject type"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "description": "Id of the employee, position, location or team"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "id"
                                            ]
                                        },
                                        "description": "Rules; empty — available to everyone",
                                        "maxItems": 500
                                    }
                                },
                                "required": [
                                    "rules"
                                ]
                            },
                            "example": {
                                "rules": [
                                    {
                                        "type": "user",
                                        "id": 42
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "rules": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "rules": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}/duplicate": {
            "post": {
                "operationId": "checklistsDuplicate",
                "summary": "Duplicate a checklist",
                "description": "Copies the checklist with all sections, questions, settings and access rules. The copy gets the original name with a fixed \"copy\" suffix (written in Russian, as in the web app) — rename it with `checklists.update`.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_duplicate",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "sections_count": {
                                                    "type": "integer"
                                                },
                                                "questions_count": {
                                                    "type": "integer"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "audits_30d": {
                                                    "type": "integer"
                                                },
                                                "avg_result_30d": {
                                                    "type": "number"
                                                },
                                                "last_audit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "ai_summary": {
                                                    "type": "boolean"
                                                },
                                                "require_location": {
                                                    "type": "boolean"
                                                },
                                                "require_signature": {
                                                    "type": "boolean"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "available_from": {
                                                    "type": "string"
                                                },
                                                "available_to": {
                                                    "type": "string"
                                                },
                                                "select_manager": {
                                                    "type": "boolean"
                                                },
                                                "send_to_location": {
                                                    "type": "boolean"
                                                },
                                                "scenario_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "access": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "responsible": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "integer"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo_required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "settings": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "unit": {
                                                                                    "type": "string"
                                                                                },
                                                                                "min": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "max": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "decimals": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "fail_all": {
                                                                                    "type": "boolean"
                                                                                }
                                                                            }
                                                                        },
                                                                        "responsible": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "position_id": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        },
                                                                        "auto_task": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "enabled": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "deadline_hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5845,
                                        "name": "Daily dining room check",
                                        "description": "Opening check of the hall, restrooms and staff",
                                        "folder": {
                                            "id": 31,
                                            "name": "Front of house"
                                        },
                                        "scoring": "points",
                                        "sections_count": 4,
                                        "questions_count": 18,
                                        "author": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "audits_30d": 12,
                                        "avg_result_30d": 81.4,
                                        "last_audit_at": "2026-11-02T18:40:00+05:00",
                                        "restricted": true,
                                        "ai_summary": false,
                                        "require_location": true,
                                        "require_signature": false,
                                        "deleted": false,
                                        "created_at": "2026-03-14T09:10:00+05:00",
                                        "updated_at": "2026-10-28T16:22:00+05:00",
                                        "url": "https://app.jecheck.io/ui/checklists/5845/edit",
                                        "available_from": "00:01",
                                        "available_to": "23:59",
                                        "select_manager": false,
                                        "send_to_location": false,
                                        "scenario_id": null,
                                        "access": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "department",
                                                "id": 12
                                            }
                                        ],
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "responsible": null,
                                                "questions": [
                                                    {
                                                        "id": 197426,
                                                        "number": 1,
                                                        "text": "Fridge temperature is within the norm",
                                                        "description": "Check the display of fridge #2",
                                                        "type": "number",
                                                        "weight": 5,
                                                        "can_skip": false,
                                                        "photo_required": true,
                                                        "settings": {
                                                            "unit": "°C",
                                                            "min": 2,
                                                            "max": 6,
                                                            "decimals": 1,
                                                            "fail_all": true
                                                        },
                                                        "responsible": {
                                                            "to": "role",
                                                            "position_id": 14
                                                        },
                                                        "auto_task": {
                                                            "enabled": true,
                                                            "deadline_hours": 24
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}/media": {
            "post": {
                "operationId": "checklistsMediaUpload",
                "summary": "Upload a reference photo",
                "description": "Uploads a reference image (\"how it should look\") and returns its public URL. Put the URL into `settings.media` of a question with `checklists.structure.update` (up to 5 per question).",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_media_upload",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "image": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Image file, up to 10 MB"
                                    }
                                },
                                "required": [
                                    "image"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "image": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "Image file, up to 10 MB"
                                    }
                                },
                                "required": [
                                    "image"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "url": "https://jecheck.s3.eu-west-1.amazonaws.com/checklists/761/reference/9f1c2b.jpg"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}/responsible": {
            "put": {
                "operationId": "checklistsResponsibleSet",
                "summary": "Set who fixes violations of a section or question",
                "description": "\"Who fixes\" a violation: `managers` — location managers, `role` — employees of a position (`position_id`), `team` — a team queue (`team_id`), `user` — a specific employee (`user_id`). `null` — default (a question inherits its section, a section — location managers). Automation scenarios and auto-tasks assign violations by this setting.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_responsible_set",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "target": {
                                        "type": "string",
                                        "enum": [
                                            "section",
                                            "question"
                                        ],
                                        "description": "What to configure"
                                    },
                                    "target_id": {
                                        "type": "integer",
                                        "description": "Section or question id of this checklist"
                                    },
                                    "responsible": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "properties": {
                                            "to": {
                                                "type": "string",
                                                "enum": [
                                                    "managers",
                                                    "role",
                                                    "team",
                                                    "user"
                                                ],
                                                "description": "Who fixes: managers, role, team or user"
                                            },
                                            "position_id": {
                                                "type": "integer"
                                            },
                                            "team_id": {
                                                "type": "integer"
                                            },
                                            "user_id": {
                                                "type": "integer"
                                            }
                                        },
                                        "description": "Target, or `null` to reset to the default"
                                    }
                                },
                                "required": [
                                    "target",
                                    "target_id",
                                    "responsible"
                                ]
                            },
                            "example": {
                                "target": "section",
                                "target_id": 42,
                                "responsible": {
                                    "to": "managers",
                                    "position_id": 42,
                                    "team_id": 42
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "target": {
                                                    "type": "string"
                                                },
                                                "target_id": {
                                                    "type": "integer"
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "to": {
                                                            "type": "string"
                                                        },
                                                        "position_id": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "target": "question",
                                        "target_id": 197426,
                                        "responsible": {
                                            "to": "role",
                                            "position_id": 14
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}/restore": {
            "post": {
                "operationId": "checklistsRestore",
                "summary": "Restore a deleted checklist",
                "description": "Returns a checklist from the trash: it is available again in the list, the planner and the app.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_restore",
                "x-permissions": [
                    "checklists.delete"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "sections_count": {
                                                    "type": "integer"
                                                },
                                                "questions_count": {
                                                    "type": "integer"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "audits_30d": {
                                                    "type": "integer"
                                                },
                                                "avg_result_30d": {
                                                    "type": "number"
                                                },
                                                "last_audit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "ai_summary": {
                                                    "type": "boolean"
                                                },
                                                "require_location": {
                                                    "type": "boolean"
                                                },
                                                "require_signature": {
                                                    "type": "boolean"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "available_from": {
                                                    "type": "string"
                                                },
                                                "available_to": {
                                                    "type": "string"
                                                },
                                                "select_manager": {
                                                    "type": "boolean"
                                                },
                                                "send_to_location": {
                                                    "type": "boolean"
                                                },
                                                "scenario_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "access": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "responsible": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "integer"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo_required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "settings": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "unit": {
                                                                                    "type": "string"
                                                                                },
                                                                                "min": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "max": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "decimals": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "fail_all": {
                                                                                    "type": "boolean"
                                                                                }
                                                                            }
                                                                        },
                                                                        "responsible": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "position_id": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        },
                                                                        "auto_task": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "enabled": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "deadline_hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5845,
                                        "name": "Daily dining room check",
                                        "description": "Opening check of the hall, restrooms and staff",
                                        "folder": {
                                            "id": 31,
                                            "name": "Front of house"
                                        },
                                        "scoring": "points",
                                        "sections_count": 4,
                                        "questions_count": 18,
                                        "author": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "audits_30d": 12,
                                        "avg_result_30d": 81.4,
                                        "last_audit_at": "2026-11-02T18:40:00+05:00",
                                        "restricted": true,
                                        "ai_summary": false,
                                        "require_location": true,
                                        "require_signature": false,
                                        "deleted": false,
                                        "created_at": "2026-03-14T09:10:00+05:00",
                                        "updated_at": "2026-10-28T16:22:00+05:00",
                                        "url": "https://app.jecheck.io/ui/checklists/5845/edit",
                                        "available_from": "00:01",
                                        "available_to": "23:59",
                                        "select_manager": false,
                                        "send_to_location": false,
                                        "scenario_id": null,
                                        "access": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "department",
                                                "id": 12
                                            }
                                        ],
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "responsible": null,
                                                "questions": [
                                                    {
                                                        "id": 197426,
                                                        "number": 1,
                                                        "text": "Fridge temperature is within the norm",
                                                        "description": "Check the display of fridge #2",
                                                        "type": "number",
                                                        "weight": 5,
                                                        "can_skip": false,
                                                        "photo_required": true,
                                                        "settings": {
                                                            "unit": "°C",
                                                            "min": 2,
                                                            "max": 6,
                                                            "decimals": 1,
                                                            "fail_all": true
                                                        },
                                                        "responsible": {
                                                            "to": "role",
                                                            "position_id": 14
                                                        },
                                                        "auto_task": {
                                                            "enabled": true,
                                                            "deadline_hours": 24
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/checklists/{id}/structure": {
            "put": {
                "operationId": "checklistsStructureUpdate",
                "summary": "Replace the checklist structure",
                "description": "Sends the whole structure at once (as in `checklists.get`). Pass `id` for sections and questions you keep — their audit history stays linked; items without `id` are created, items not listed are removed. Existing sections cannot be reordered (new ones are appended at the end); questions can be reordered and moved between sections. For an existing question without `settings` the current settings are kept.",
                "tags": [
                    "Checklists"
                ],
                "x-mcp-tool": "checklists_structure_update",
                "x-permissions": [
                    "checklists.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Checklist id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name (kept if omitted)",
                                        "minLength": 5,
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "New description (kept if omitted)",
                                        "maxLength": 5000
                                    },
                                    "sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Existing section id to keep; omit for a new section"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "description": "Section name",
                                                    "minLength": 2,
                                                    "maxLength": 512
                                                },
                                                "questions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ],
                                                                "description": "Existing question id to keep (its audit history stays linked); omit for a new question"
                                                            },
                                                            "text": {
                                                                "type": "string",
                                                                "description": "Question wording (at least 5 characters)",
                                                                "minLength": 5,
                                                                "maxLength": 2000
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "description": "Hint for the auditor",
                                                                "maxLength": 5000
                                                            },
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "yes_no",
                                                                    "text",
                                                                    "choice",
                                                                    "multi",
                                                                    "number",
                                                                    "scale",
                                                                    "date",
                                                                    "signature",
                                                                    "photo",
                                                                    "instruction",
                                                                    "barcode",
                                                                    "employee"
                                                                ],
                                                                "default": "yes_no",
                                                                "description": "Answer type. `yes_no` (default) — complies / violation / not applicable; `choice`/`multi` need `settings.options`; `number` may have a norm `settings.min`/`max`; see the Checklists guide"
                                                            },
                                                            "weight": {
                                                                "type": "integer",
                                                                "default": 1,
                                                                "description": "Weight (points) of the question, 1–100",
                                                                "minimum": 1,
                                                                "maximum": 100
                                                            },
                                                            "photo_required": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "The auditor must attach a photo"
                                                            },
                                                            "can_skip": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "The question may be skipped"
                                                            },
                                                            "fail_all": {
                                                                "type": "boolean",
                                                                "description": "A violation on this question sets the whole audit result to 0 (scored types only)"
                                                            },
                                                            "settings": {
                                                                "type": [
                                                                    "object",
                                                                    "null"
                                                                ],
                                                                "properties": {},
                                                                "additionalProperties": true,
                                                                "description": "Type settings, e.g. `{\"options\":[{\"id\":\"a1\",\"label\":\"Clean\",\"result\":1,\"score\":1},{\"id\":\"a2\",\"label\":\"Dirty\",\"result\":2,\"score\":0}]}` for `choice`, `{\"unit\":\"°C\",\"min\":2,\"max\":6}` for `number`, `{\"min\":1,\"max\":5,\"pass\":4}` for `scale`; common keys `fail_all`, `show_if`, `media`"
                                                            }
                                                        },
                                                        "required": [
                                                            "text"
                                                        ]
                                                    },
                                                    "description": "Questions of the section, in order"
                                                }
                                            },
                                            "required": [
                                                "name",
                                                "questions"
                                            ]
                                        },
                                        "description": "The complete new structure. Existing sections keep their order (new sections can only be appended); sections and questions not listed are removed",
                                        "maxItems": 60
                                    }
                                },
                                "required": [
                                    "sections"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "sections": [
                                    {
                                        "id": 42,
                                        "name": "Replace the broken fridge seal",
                                        "questions": [
                                            {
                                                "id": 42,
                                                "text": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "scoring": {
                                                    "type": "string"
                                                },
                                                "sections_count": {
                                                    "type": "integer"
                                                },
                                                "questions_count": {
                                                    "type": "integer"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "audits_30d": {
                                                    "type": "integer"
                                                },
                                                "avg_result_30d": {
                                                    "type": "number"
                                                },
                                                "last_audit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "ai_summary": {
                                                    "type": "boolean"
                                                },
                                                "require_location": {
                                                    "type": "boolean"
                                                },
                                                "require_signature": {
                                                    "type": "boolean"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "available_from": {
                                                    "type": "string"
                                                },
                                                "available_to": {
                                                    "type": "string"
                                                },
                                                "select_manager": {
                                                    "type": "boolean"
                                                },
                                                "send_to_location": {
                                                    "type": "boolean"
                                                },
                                                "scenario_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "access": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "responsible": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "number": {
                                                                            "type": "integer"
                                                                        },
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo_required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "settings": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "unit": {
                                                                                    "type": "string"
                                                                                },
                                                                                "min": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "max": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "decimals": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "fail_all": {
                                                                                    "type": "boolean"
                                                                                }
                                                                            }
                                                                        },
                                                                        "responsible": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "to": {
                                                                                    "type": "string"
                                                                                },
                                                                                "position_id": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        },
                                                                        "auto_task": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "enabled": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "deadline_hours": {
                                                                                    "type": "integer"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5845,
                                        "name": "Daily dining room check",
                                        "description": "Opening check of the hall, restrooms and staff",
                                        "folder": {
                                            "id": 31,
                                            "name": "Front of house"
                                        },
                                        "scoring": "points",
                                        "sections_count": 4,
                                        "questions_count": 18,
                                        "author": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "audits_30d": 12,
                                        "avg_result_30d": 81.4,
                                        "last_audit_at": "2026-11-02T18:40:00+05:00",
                                        "restricted": true,
                                        "ai_summary": false,
                                        "require_location": true,
                                        "require_signature": false,
                                        "deleted": false,
                                        "created_at": "2026-03-14T09:10:00+05:00",
                                        "updated_at": "2026-10-28T16:22:00+05:00",
                                        "url": "https://app.jecheck.io/ui/checklists/5845/edit",
                                        "available_from": "00:01",
                                        "available_to": "23:59",
                                        "select_manager": false,
                                        "send_to_location": false,
                                        "scenario_id": null,
                                        "access": [
                                            {
                                                "type": "position",
                                                "id": 14
                                            },
                                            {
                                                "type": "department",
                                                "id": 12
                                            }
                                        ],
                                        "sections": [
                                            {
                                                "id": 21626,
                                                "name": "Kitchen",
                                                "responsible": null,
                                                "questions": [
                                                    {
                                                        "id": 197426,
                                                        "number": 1,
                                                        "text": "Fridge temperature is within the norm",
                                                        "description": "Check the display of fridge #2",
                                                        "type": "number",
                                                        "weight": 5,
                                                        "can_skip": false,
                                                        "photo_required": true,
                                                        "settings": {
                                                            "unit": "°C",
                                                            "min": 2,
                                                            "max": 6,
                                                            "decimals": 1,
                                                            "fail_all": true
                                                        },
                                                        "responsible": {
                                                            "to": "role",
                                                            "position_id": 14
                                                        },
                                                        "auto_task": {
                                                            "enabled": true,
                                                            "deadline_hours": 24
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/company": {
            "get": {
                "operationId": "accountCompany",
                "summary": "Get the company profile",
                "description": "Company settings that matter for integrations: name, country, language of reports, time zone, plan and its paid features, number of locations.",
                "tags": [
                    "Account"
                ],
                "x-mcp-tool": "account_company",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "country": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "plan": {
                                                    "type": "object",
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "features": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "limits": {
                                                            "type": "object",
                                                            "properties": {
                                                                "audits_per_day": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "audits_today": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "files_per_audit": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "locations_count": {
                                                    "type": "integer"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 761,
                                        "name": "Coffee Lab",
                                        "country": "KZ",
                                        "locale": "ru",
                                        "timezone": "Asia/Almaty",
                                        "plan": {
                                            "key": "enterprise",
                                            "until": null,
                                            "features": [
                                                "automation",
                                                "ai",
                                                "testing",
                                                "haccp",
                                                "api"
                                            ],
                                            "limits": {
                                                "audits_per_day": null,
                                                "audits_today": null,
                                                "files_per_audit": null
                                            }
                                        },
                                        "locations_count": 14,
                                        "created_at": "2024-03-02T09:15:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards": {
            "get": {
                "operationId": "dashboardsList",
                "summary": "List dashboards",
                "description": "Dashboards visible to the acting user: own, shared with them and published to the whole company, in the user's tab order.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "include_hidden",
                        "in": "query",
                        "description": "Include dashboards the user hid from tabs",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "filters": {
                                                        "type": "object",
                                                        "properties": {
                                                            "period": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "date_to": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "location_ids": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "checklist_ids": {
                                                                "type": "array"
                                                            },
                                                            "auditor_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    },
                                                    "visibility": {
                                                        "type": "string"
                                                    },
                                                    "company_can_edit": {
                                                        "type": "boolean"
                                                    },
                                                    "refresh_sec": {
                                                        "type": "integer"
                                                    },
                                                    "template": {
                                                        "type": "string"
                                                    },
                                                    "owner": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "is_owner": {
                                                        "type": "boolean"
                                                    },
                                                    "permissions": {
                                                        "type": "object",
                                                        "properties": {
                                                            "edit": {
                                                                "type": "boolean"
                                                            },
                                                            "share": {
                                                                "type": "boolean"
                                                            },
                                                            "delete": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "hidden": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                            "title": "Location overview",
                                            "icon": "dashboard",
                                            "description": "Weekly picture of all coffee shops",
                                            "filters": {
                                                "period": "30d",
                                                "date_from": null,
                                                "date_to": null,
                                                "location_ids": [
                                                    12,
                                                    14
                                                ],
                                                "checklist_ids": [],
                                                "auditor_ids": []
                                            },
                                            "visibility": "company",
                                            "company_can_edit": false,
                                            "refresh_sec": 0,
                                            "template": "location",
                                            "owner": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "is_owner": false,
                                            "permissions": {
                                                "edit": false,
                                                "share": false,
                                                "delete": false
                                            },
                                            "updated_at": "2026-11-03T12:10:00+05:00",
                                            "url": "https://app.jecheck.io/ui/dashboards/2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                            "hidden": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "dashboardsCreate",
                "summary": "Create a dashboard",
                "description": "Creates a private dashboard of the acting user — empty, from a template (`dashboards.catalog` → templates) and/or with the given cards. Publish it with `dashboards.share`.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_create",
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Title",
                                        "maxLength": 120
                                    },
                                    "icon": {
                                        "type": "string",
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 500
                                    },
                                    "template": {
                                        "type": "string",
                                        "enum": [
                                            "network",
                                            "quality",
                                            "operations",
                                            "location",
                                            "haccp",
                                            "training",
                                            "mystery"
                                        ],
                                        "description": "Template key"
                                    },
                                    "widgets": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "spec": {
                                                    "type": "object",
                                                    "properties": {},
                                                    "additionalProperties": true,
                                                    "description": "Card definition"
                                                },
                                                "x": {
                                                    "type": "integer"
                                                },
                                                "y": {
                                                    "type": "integer"
                                                },
                                                "w": {
                                                    "type": "integer"
                                                },
                                                "h": {
                                                    "type": "integer"
                                                },
                                                "preset": {
                                                    "type": "string",
                                                    "description": "Ready-made card key",
                                                    "maxLength": 60
                                                }
                                            },
                                            "required": [
                                                "spec"
                                            ]
                                        },
                                        "description": "Cards to add (layout is packed automatically when x/y are omitted)",
                                        "maxItems": 60
                                    }
                                }
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "icon": "string",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "template": "network"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "properties": {
                                                        "period": {
                                                            "type": "string"
                                                        },
                                                        "date_from": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "date_to": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "location_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "checklist_ids": {
                                                            "type": "array"
                                                        },
                                                        "auditor_ids": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "company_can_edit": {
                                                    "type": "boolean"
                                                },
                                                "refresh_sec": {
                                                    "type": "integer"
                                                },
                                                "template": {
                                                    "type": "string"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "is_owner": {
                                                    "type": "boolean"
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "share": {
                                                            "type": "boolean"
                                                        },
                                                        "delete": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "widgets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "spec": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "metrics": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "compare": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "x": {
                                                                "type": "integer"
                                                            },
                                                            "y": {
                                                                "type": "integer"
                                                            },
                                                            "w": {
                                                                "type": "integer"
                                                            },
                                                            "h": {
                                                                "type": "integer"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "preset": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "title": "Location overview",
                                        "icon": "dashboard",
                                        "description": "Weekly picture of all coffee shops",
                                        "filters": {
                                            "period": "30d",
                                            "date_from": null,
                                            "date_to": null,
                                            "location_ids": [
                                                12,
                                                14
                                            ],
                                            "checklist_ids": [],
                                            "auditor_ids": []
                                        },
                                        "visibility": "company",
                                        "company_can_edit": false,
                                        "refresh_sec": 0,
                                        "template": "location",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "is_owner": false,
                                        "permissions": {
                                            "edit": false,
                                            "share": false,
                                            "delete": false
                                        },
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/dashboards/2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "widgets": [
                                            {
                                                "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "spec": {
                                                    "v": 1,
                                                    "type": "kpi",
                                                    "metrics": [
                                                        "audits.avg_result"
                                                    ],
                                                    "compare": true,
                                                    "title": "Average score"
                                                },
                                                "x": 0,
                                                "y": 0,
                                                "w": 3,
                                                "h": 2,
                                                "source": "library",
                                                "preset": "kpi_avg"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/ai/card": {
            "post": {
                "operationId": "dashboardsAiCard",
                "summary": "Build a card from a description (AI)",
                "description": "AI turns a request in plain words (\"average score by location for 90 days\") into a card definition and computes it. Nothing is saved — add it with `dashboards.widgets.create`. Daily AI limits apply.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_ai_card",
                "x-plan-feature": "ai",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "prompt": {
                                        "type": "string",
                                        "maxLength": 1000
                                    },
                                    "spec": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Current card to adjust"
                                    },
                                    "period": {
                                        "type": "string",
                                        "enum": [
                                            "7d",
                                            "30d",
                                            "90d",
                                            "12m",
                                            "custom"
                                        ],
                                        "description": "Period; `custom` needs `date_from` and `date_to`"
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Start of a custom period"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "End of a custom period"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these locations (within the viewer's permissions)"
                                    },
                                    "checklist_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these checklists"
                                    },
                                    "auditor_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these auditors"
                                    }
                                },
                                "required": [
                                    "prompt"
                                ]
                            },
                            "example": {
                                "prompt": "string",
                                "spec": [],
                                "period": "7d",
                                "date_from": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "spec": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "metrics": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "compare": {
                                                            "type": "boolean"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "explanation": {
                                                    "type": "string"
                                                },
                                                "size": {
                                                    "type": "object",
                                                    "properties": {
                                                        "w": {
                                                            "type": "integer"
                                                        },
                                                        "h": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "kind": {
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "type": "number"
                                                        },
                                                        "previous": {
                                                            "type": "number"
                                                        },
                                                        "unit": {
                                                            "type": "string"
                                                        },
                                                        "meta": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "spec": {
                                            "v": 1,
                                            "type": "kpi",
                                            "metrics": [
                                                "audits.avg_result"
                                            ],
                                            "compare": true,
                                            "title": "Average score"
                                        },
                                        "explanation": "Average audit score with comparison to the previous period",
                                        "size": {
                                            "w": 3,
                                            "h": 2
                                        },
                                        "data": {
                                            "kind": "value",
                                            "value": 82.4,
                                            "previous": 79.1,
                                            "unit": "%",
                                            "meta": {
                                                "from": "2026-10-04",
                                                "to": "2026-11-03"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/ai/dashboard": {
            "post": {
                "operationId": "dashboardsAiDashboard",
                "summary": "Draft a dashboard from a description (AI)",
                "description": "Returns a draft (title, cards and layout) — nothing is saved; pass `widgets` to `dashboards.create`.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_ai_dashboard",
                "x-plan-feature": "ai",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "prompt": {
                                        "type": "string",
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "prompt"
                                ]
                            },
                            "example": {
                                "prompt": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "explanation": {
                                                    "type": "string"
                                                },
                                                "widgets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "spec": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "metrics": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "compare": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "x": {
                                                                "type": "integer"
                                                            },
                                                            "y": {
                                                                "type": "integer"
                                                            },
                                                            "w": {
                                                                "type": "integer"
                                                            },
                                                            "h": {
                                                                "type": "integer"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "title": "Kitchen quality",
                                        "icon": "restaurant",
                                        "explanation": "Scores, failed questions and overdue tasks",
                                        "widgets": [
                                            {
                                                "spec": {
                                                    "v": 1,
                                                    "type": "kpi",
                                                    "metrics": [
                                                        "audits.avg_result"
                                                    ],
                                                    "compare": true,
                                                    "title": "Average score"
                                                },
                                                "x": 0,
                                                "y": 0,
                                                "w": 3,
                                                "h": 2,
                                                "source": "ai"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/catalog": {
            "get": {
                "operationId": "dashboardsCatalog",
                "summary": "Get the metrics catalog",
                "description": "Everything a card can be built from: metric groups, metrics (unit, which direction is better, allowed dimensions, availability for the acting user), dimensions, card types and their rules, lists, periods, ready-made cards (`presets`) and dashboard templates.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_catalog",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "groups": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "dimensions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "types": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": "string"
                                                            },
                                                            "metrics": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "dimension": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "metrics": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "group": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "better": {
                                                                "type": "string"
                                                            },
                                                            "dimensions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "snapshot": {
                                                                "type": "boolean"
                                                            },
                                                            "available": {
                                                                "type": "boolean"
                                                            },
                                                            "reason": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "lists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "group": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "available": {
                                                                "type": "boolean"
                                                            },
                                                            "reason": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "periods": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "presets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "group": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "spec": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "metrics": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "compare": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            },
                                                            "w": {
                                                                "type": "integer"
                                                            },
                                                            "h": {
                                                                "type": "integer"
                                                            },
                                                            "available": {
                                                                "type": "boolean"
                                                            },
                                                            "reason": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "templates": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": "string"
                                                            },
                                                            "presets": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "groups": [
                                            {
                                                "key": "audits",
                                                "label": "Audits",
                                                "icon": "fact_check"
                                            }
                                        ],
                                        "dimensions": [
                                            {
                                                "key": "location",
                                                "label": "Location",
                                                "kind": "category"
                                            }
                                        ],
                                        "types": [
                                            {
                                                "key": "kpi",
                                                "label": "Number",
                                                "icon": "pin",
                                                "metrics": [
                                                    1,
                                                    1
                                                ],
                                                "dimension": false
                                            }
                                        ],
                                        "metrics": [
                                            {
                                                "key": "audits.avg_result",
                                                "group": "audits",
                                                "label": "Average score",
                                                "description": "Average audit result",
                                                "unit": "%",
                                                "better": "up",
                                                "dimensions": [
                                                    "time",
                                                    "location",
                                                    "checklist"
                                                ],
                                                "snapshot": false,
                                                "available": true,
                                                "reason": null
                                            }
                                        ],
                                        "lists": [
                                            {
                                                "key": "tasks.overdue",
                                                "group": "tasks",
                                                "label": "Overdue tasks",
                                                "description": "Open tasks past due",
                                                "available": true,
                                                "reason": null
                                            }
                                        ],
                                        "periods": [
                                            {
                                                "key": "30d",
                                                "label": "30 days"
                                            }
                                        ],
                                        "presets": [
                                            {
                                                "key": "kpi_avg",
                                                "group": "audits",
                                                "label": "Average score",
                                                "description": "Average audit result with trend",
                                                "type": "kpi",
                                                "spec": {
                                                    "v": 1,
                                                    "type": "kpi",
                                                    "metrics": [
                                                        "audits.avg_result"
                                                    ],
                                                    "compare": true
                                                },
                                                "w": 3,
                                                "h": 2,
                                                "available": true,
                                                "reason": null
                                            }
                                        ],
                                        "templates": [
                                            {
                                                "key": "location",
                                                "label": "Location overview",
                                                "description": "Key figures of locations",
                                                "icon": "storefront",
                                                "presets": [
                                                    "kpi_avg"
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/order": {
            "put": {
                "operationId": "dashboardsReorder",
                "summary": "Reorder and hide dashboard tabs",
                "description": "Personal tab order of the acting user; `hidden` — dashboards to hide from the tabs.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_reorder",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "uuids": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Dashboard UUIDs in the new order",
                                        "maxItems": 200
                                    },
                                    "hidden": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Hidden dashboard UUIDs",
                                        "maxItems": 200
                                    }
                                },
                                "required": [
                                    "uuids"
                                ]
                            },
                            "example": {
                                "uuids": [
                                    "example"
                                ],
                                "hidden": [
                                    "example"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "ok": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/preview": {
            "post": {
                "operationId": "dashboardsPreview",
                "summary": "Compute a card without saving it",
                "description": "Runs a card definition with the given filters — use it to try a `spec` before adding the card.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_preview",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "spec": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Card definition: {\"type\", \"metrics\", \"dimension\", \"dimension2\", \"list\", \"period\", \"title\", \"target\", \"compare\", \"limit\", \"color\", \"text\"} — see `dashboards.catalog` for metric, dimension, list and type keys"
                                    },
                                    "period": {
                                        "type": "string",
                                        "enum": [
                                            "7d",
                                            "30d",
                                            "90d",
                                            "12m",
                                            "custom"
                                        ],
                                        "description": "Period; `custom` needs `date_from` and `date_to`"
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Start of a custom period"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "End of a custom period"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these locations (within the viewer's permissions)"
                                    },
                                    "checklist_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these checklists"
                                    },
                                    "auditor_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these auditors"
                                    }
                                },
                                "required": [
                                    "spec"
                                ]
                            },
                            "example": {
                                "spec": [],
                                "period": "7d",
                                "date_from": "2026-11-01",
                                "date_to": "2026-11-30"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "value": {
                                                    "type": "number"
                                                },
                                                "previous": {
                                                    "type": "number"
                                                },
                                                "unit": {
                                                    "type": "string"
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "kind": "value",
                                        "value": 82.4,
                                        "previous": 79.1,
                                        "unit": "%",
                                        "meta": {
                                            "from": "2026-10-04",
                                            "to": "2026-11-03"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}": {
            "get": {
                "operationId": "dashboardsGet",
                "summary": "Retrieve a dashboard",
                "description": "Dashboard settings, saved filters, the acting user's permissions and the cards with their layout on a 12-column grid. Card values — `dashboards.data`.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "properties": {
                                                        "period": {
                                                            "type": "string"
                                                        },
                                                        "date_from": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "date_to": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "location_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "checklist_ids": {
                                                            "type": "array"
                                                        },
                                                        "auditor_ids": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "company_can_edit": {
                                                    "type": "boolean"
                                                },
                                                "refresh_sec": {
                                                    "type": "integer"
                                                },
                                                "template": {
                                                    "type": "string"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "is_owner": {
                                                    "type": "boolean"
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "share": {
                                                            "type": "boolean"
                                                        },
                                                        "delete": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "widgets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "spec": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "metrics": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "compare": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "x": {
                                                                "type": "integer"
                                                            },
                                                            "y": {
                                                                "type": "integer"
                                                            },
                                                            "w": {
                                                                "type": "integer"
                                                            },
                                                            "h": {
                                                                "type": "integer"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "preset": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "title": "Location overview",
                                        "icon": "dashboard",
                                        "description": "Weekly picture of all coffee shops",
                                        "filters": {
                                            "period": "30d",
                                            "date_from": null,
                                            "date_to": null,
                                            "location_ids": [
                                                12,
                                                14
                                            ],
                                            "checklist_ids": [],
                                            "auditor_ids": []
                                        },
                                        "visibility": "company",
                                        "company_can_edit": false,
                                        "refresh_sec": 0,
                                        "template": "location",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "is_owner": false,
                                        "permissions": {
                                            "edit": false,
                                            "share": false,
                                            "delete": false
                                        },
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/dashboards/2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "widgets": [
                                            {
                                                "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "spec": {
                                                    "v": 1,
                                                    "type": "kpi",
                                                    "metrics": [
                                                        "audits.avg_result"
                                                    ],
                                                    "compare": true,
                                                    "title": "Average score"
                                                },
                                                "x": 0,
                                                "y": 0,
                                                "w": 3,
                                                "h": 2,
                                                "source": "library",
                                                "preset": "kpi_avg"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "dashboardsUpdate",
                "summary": "Update a dashboard",
                "description": "Title, icon, description, saved filters and auto-refresh. Requires edit access.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 40
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "filters": {
                                        "type": "object",
                                        "properties": {
                                            "period": {
                                                "type": "string",
                                                "enum": [
                                                    "7d",
                                                    "30d",
                                                    "90d",
                                                    "12m",
                                                    "custom"
                                                ],
                                                "description": "Period; `custom` needs `date_from` and `date_to`"
                                            },
                                            "date_from": {
                                                "type": "string",
                                                "format": "date",
                                                "description": "Start of a custom period"
                                            },
                                            "date_to": {
                                                "type": "string",
                                                "format": "date",
                                                "description": "End of a custom period"
                                            },
                                            "location_ids": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                },
                                                "description": "Only these locations (within the viewer's permissions)"
                                            },
                                            "checklist_ids": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                },
                                                "description": "Only these checklists"
                                            },
                                            "auditor_ids": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                },
                                                "description": "Only these auditors"
                                            }
                                        },
                                        "description": "Saved filters: period, date_from, date_to, location_ids, checklist_ids, auditor_ids"
                                    },
                                    "refresh_sec": {
                                        "type": "integer",
                                        "description": "Auto-refresh in the web app, seconds (0 — off, minimum 60)",
                                        "minimum": 0,
                                        "maximum": 3600
                                    }
                                }
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "icon": "string",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "filters": {
                                    "period": "7d",
                                    "date_from": "2026-11-01",
                                    "date_to": "2026-11-30"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "properties": {
                                                        "period": {
                                                            "type": "string"
                                                        },
                                                        "date_from": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "date_to": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "location_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "checklist_ids": {
                                                            "type": "array"
                                                        },
                                                        "auditor_ids": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "company_can_edit": {
                                                    "type": "boolean"
                                                },
                                                "refresh_sec": {
                                                    "type": "integer"
                                                },
                                                "template": {
                                                    "type": "string"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "is_owner": {
                                                    "type": "boolean"
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "share": {
                                                            "type": "boolean"
                                                        },
                                                        "delete": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "widgets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "spec": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "metrics": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "compare": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "x": {
                                                                "type": "integer"
                                                            },
                                                            "y": {
                                                                "type": "integer"
                                                            },
                                                            "w": {
                                                                "type": "integer"
                                                            },
                                                            "h": {
                                                                "type": "integer"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "preset": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "title": "Location overview",
                                        "icon": "dashboard",
                                        "description": "Weekly picture of all coffee shops",
                                        "filters": {
                                            "period": "30d",
                                            "date_from": null,
                                            "date_to": null,
                                            "location_ids": [
                                                12,
                                                14
                                            ],
                                            "checklist_ids": [],
                                            "auditor_ids": []
                                        },
                                        "visibility": "company",
                                        "company_can_edit": false,
                                        "refresh_sec": 0,
                                        "template": "location",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "is_owner": false,
                                        "permissions": {
                                            "edit": false,
                                            "share": false,
                                            "delete": false
                                        },
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/dashboards/2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "widgets": [
                                            {
                                                "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "spec": {
                                                    "v": 1,
                                                    "type": "kpi",
                                                    "metrics": [
                                                        "audits.avg_result"
                                                    ],
                                                    "compare": true,
                                                    "title": "Average score"
                                                },
                                                "x": 0,
                                                "y": 0,
                                                "w": 3,
                                                "h": 2,
                                                "source": "library",
                                                "preset": "kpi_avg"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "dashboardsDelete",
                "summary": "Delete a dashboard",
                "description": "Allowed to the owner; a company dashboard — also with `dashboards.company`.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/data": {
            "get": {
                "operationId": "dashboardsData",
                "summary": "Get computed data of all cards",
                "description": "Values of every card (or of `widget_uuids`), keyed by card UUID. Computed with the dashboard filters, or with the filters passed here (temporary, not saved). Data is always limited by the acting user's permissions; a card the user may not see returns `{\"error\": \"...\", \"message\": \"...\"}`.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_data",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "widget_uuids[]",
                        "in": "query",
                        "description": "Only these cards",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 60
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` needs `date_from` and `date_to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ]
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations (within the viewer's permissions)",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only these auditors",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d": {
                                                    "type": "object",
                                                    "properties": {
                                                        "kind": {
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "type": "number"
                                                        },
                                                        "previous": {
                                                            "type": "number"
                                                        },
                                                        "unit": {
                                                            "type": "string"
                                                        },
                                                        "meta": {
                                                            "type": "object",
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d": {
                                            "kind": "value",
                                            "value": 82.4,
                                            "previous": 79.1,
                                            "unit": "%",
                                            "meta": {
                                                "from": "2026-10-04",
                                                "to": "2026-11-03"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/duplicate": {
            "post": {
                "operationId": "dashboardsDuplicate",
                "summary": "Duplicate a dashboard",
                "description": "Creates a private copy owned by the acting user.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_duplicate",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "properties": {
                                                        "period": {
                                                            "type": "string"
                                                        },
                                                        "date_from": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "date_to": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "location_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "checklist_ids": {
                                                            "type": "array"
                                                        },
                                                        "auditor_ids": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "company_can_edit": {
                                                    "type": "boolean"
                                                },
                                                "refresh_sec": {
                                                    "type": "integer"
                                                },
                                                "template": {
                                                    "type": "string"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "is_owner": {
                                                    "type": "boolean"
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "share": {
                                                            "type": "boolean"
                                                        },
                                                        "delete": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "widgets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "spec": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "v": {
                                                                        "type": "integer"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "metrics": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "compare": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "x": {
                                                                "type": "integer"
                                                            },
                                                            "y": {
                                                                "type": "integer"
                                                            },
                                                            "w": {
                                                                "type": "integer"
                                                            },
                                                            "h": {
                                                                "type": "integer"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "preset": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "title": "Location overview",
                                        "icon": "dashboard",
                                        "description": "Weekly picture of all coffee shops",
                                        "filters": {
                                            "period": "30d",
                                            "date_from": null,
                                            "date_to": null,
                                            "location_ids": [
                                                12,
                                                14
                                            ],
                                            "checklist_ids": [],
                                            "auditor_ids": []
                                        },
                                        "visibility": "company",
                                        "company_can_edit": false,
                                        "refresh_sec": 0,
                                        "template": "location",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "is_owner": false,
                                        "permissions": {
                                            "edit": false,
                                            "share": false,
                                            "delete": false
                                        },
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/dashboards/2a1b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                        "widgets": [
                                            {
                                                "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "spec": {
                                                    "v": 1,
                                                    "type": "kpi",
                                                    "metrics": [
                                                        "audits.avg_result"
                                                    ],
                                                    "compare": true,
                                                    "title": "Average score"
                                                },
                                                "x": 0,
                                                "y": 0,
                                                "w": 3,
                                                "h": 2,
                                                "source": "library",
                                                "preset": "kpi_avg"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/layout": {
            "put": {
                "operationId": "dashboardsLayout",
                "summary": "Change the card layout",
                "description": "Positions and sizes of cards on the 12-column grid. Requires edit access.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_layout",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid",
                                                    "description": "Card UUID"
                                                },
                                                "x": {
                                                    "type": "integer"
                                                },
                                                "y": {
                                                    "type": "integer"
                                                },
                                                "w": {
                                                    "type": "integer"
                                                },
                                                "h": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "uuid",
                                                "x",
                                                "y",
                                                "w",
                                                "h"
                                            ]
                                        },
                                        "maxItems": 60
                                    }
                                },
                                "required": [
                                    "items"
                                ]
                            },
                            "example": {
                                "items": [
                                    {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "x": 42,
                                        "y": 42,
                                        "w": 42,
                                        "h": 42
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "spec": {
                                                        "type": "object",
                                                        "properties": {
                                                            "v": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "metrics": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "compare": {
                                                                "type": "boolean"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "x": {
                                                        "type": "integer"
                                                    },
                                                    "y": {
                                                        "type": "integer"
                                                    },
                                                    "w": {
                                                        "type": "integer"
                                                    },
                                                    "h": {
                                                        "type": "integer"
                                                    },
                                                    "source": {
                                                        "type": "string"
                                                    },
                                                    "preset": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "spec": {
                                                "v": 1,
                                                "type": "kpi",
                                                "metrics": [
                                                    "audits.avg_result"
                                                ],
                                                "compare": true,
                                                "title": "Average score"
                                            },
                                            "x": 0,
                                            "y": 0,
                                            "w": 3,
                                            "h": 2,
                                            "source": "library",
                                            "preset": "kpi_avg"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/share": {
            "get": {
                "operationId": "dashboardsSharing",
                "summary": "Get dashboard sharing",
                "description": "Who has access: visibility (`private` / `company`), whether everyone may edit a company dashboard, and colleagues with personal access. For the owner (and `dashboards.company` on company dashboards).",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_sharing",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "company_can_edit": {
                                                    "type": "boolean"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shares": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "can_edit": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_publish_to_company": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "visibility": "private",
                                        "company_can_edit": false,
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "shares": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "can_edit": true
                                            }
                                        ],
                                        "can_publish_to_company": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "dashboardsShare",
                "summary": "Share a dashboard",
                "description": "Replaces the sharing settings. Publishing to the whole company requires `dashboards.company`.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_share",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "private",
                                            "company"
                                        ]
                                    },
                                    "company_can_edit": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Everyone in the company may edit (company dashboards)"
                                    },
                                    "users": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "user_id"
                                            ]
                                        },
                                        "description": "Personal access (replaces the list)",
                                        "maxItems": 500
                                    }
                                },
                                "required": [
                                    "visibility"
                                ]
                            },
                            "example": {
                                "visibility": "private",
                                "company_can_edit": false,
                                "users": [
                                    {
                                        "user_id": 42,
                                        "can_edit": true
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "company_can_edit": {
                                                    "type": "boolean"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shares": {
                                                    "type": "array"
                                                },
                                                "can_publish_to_company": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "visibility": "company",
                                        "company_can_edit": false,
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "shares": [],
                                        "can_publish_to_company": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/widgets": {
            "post": {
                "operationId": "dashboardsWidgetsCreate",
                "summary": "Add a card",
                "description": "Adds a card (custom `spec` or a ready-made `preset` spec from the catalog). Without x/y it goes below the existing cards. Up to 60 cards per dashboard. Requires edit access.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_widgets_create",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "spec": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Card definition: {\"type\", \"metrics\", \"dimension\", \"dimension2\", \"list\", \"period\", \"title\", \"target\", \"compare\", \"limit\", \"color\", \"text\"} — see `dashboards.catalog` for metric, dimension, list and type keys"
                                    },
                                    "x": {
                                        "type": "integer"
                                    },
                                    "y": {
                                        "type": "integer"
                                    },
                                    "w": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                    },
                                    "h": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                    },
                                    "preset": {
                                        "type": "string",
                                        "description": "Ready-made card key (for reference)",
                                        "maxLength": 60
                                    }
                                },
                                "required": [
                                    "spec"
                                ]
                            },
                            "example": {
                                "spec": [],
                                "x": 42,
                                "y": 42,
                                "w": 42
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "spec": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "metrics": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "compare": {
                                                            "type": "boolean"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "x": {
                                                    "type": "integer"
                                                },
                                                "y": {
                                                    "type": "integer"
                                                },
                                                "w": {
                                                    "type": "integer"
                                                },
                                                "h": {
                                                    "type": "integer"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "preset": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                        "spec": {
                                            "v": 1,
                                            "type": "kpi",
                                            "metrics": [
                                                "audits.avg_result"
                                            ],
                                            "compare": true,
                                            "title": "Average score"
                                        },
                                        "x": 0,
                                        "y": 0,
                                        "w": 3,
                                        "h": 2,
                                        "source": "library",
                                        "preset": "kpi_avg"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/widgets/{widget_uuid}": {
            "put": {
                "operationId": "dashboardsWidgetsUpdate",
                "summary": "Replace a card definition",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_widgets_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "widget_uuid",
                        "in": "path",
                        "required": true,
                        "description": "Card UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "spec": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Card definition: {\"type\", \"metrics\", \"dimension\", \"dimension2\", \"list\", \"period\", \"title\", \"target\", \"compare\", \"limit\", \"color\", \"text\"} — see `dashboards.catalog` for metric, dimension, list and type keys"
                                    }
                                },
                                "required": [
                                    "spec"
                                ]
                            },
                            "example": {
                                "spec": []
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "spec": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "metrics": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "compare": {
                                                            "type": "boolean"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "x": {
                                                    "type": "integer"
                                                },
                                                "y": {
                                                    "type": "integer"
                                                },
                                                "w": {
                                                    "type": "integer"
                                                },
                                                "h": {
                                                    "type": "integer"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "preset": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                        "spec": {
                                            "v": 1,
                                            "type": "kpi",
                                            "metrics": [
                                                "audits.avg_result"
                                            ],
                                            "compare": true,
                                            "title": "Average score"
                                        },
                                        "x": 0,
                                        "y": 0,
                                        "w": 3,
                                        "h": 2,
                                        "source": "library",
                                        "preset": "kpi_avg"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "dashboardsWidgetsDelete",
                "summary": "Delete a card",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_widgets_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "widget_uuid",
                        "in": "path",
                        "required": true,
                        "description": "Card UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/widgets/{widget_uuid}/copy": {
            "post": {
                "operationId": "dashboardsWidgetsCopy",
                "summary": "Copy a card to another dashboard",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_widgets_copy",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "widget_uuid",
                        "in": "path",
                        "required": true,
                        "description": "Card UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "target_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Target dashboard (edit access required)"
                                    }
                                },
                                "required": [
                                    "target_uuid"
                                ]
                            },
                            "example": {
                                "target_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "spec": {
                                                    "type": "object",
                                                    "properties": {
                                                        "v": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "metrics": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "compare": {
                                                            "type": "boolean"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "x": {
                                                    "type": "integer"
                                                },
                                                "y": {
                                                    "type": "integer"
                                                },
                                                "w": {
                                                    "type": "integer"
                                                },
                                                "h": {
                                                    "type": "integer"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "preset": {
                                                    "type": "string"
                                                },
                                                "dashboard_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "7c6b5a4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                        "spec": {
                                            "v": 1,
                                            "type": "kpi",
                                            "metrics": [
                                                "audits.avg_result"
                                            ],
                                            "compare": true,
                                            "title": "Average score"
                                        },
                                        "x": 0,
                                        "y": 0,
                                        "w": 3,
                                        "h": 2,
                                        "source": "library",
                                        "preset": "kpi_avg",
                                        "dashboard_uuid": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/widgets/{widget_uuid}/data": {
            "get": {
                "operationId": "dashboardsWidgetsData",
                "summary": "Get computed data of a card",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_widgets_data",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "widget_uuid",
                        "in": "path",
                        "required": true,
                        "description": "Card UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Period; `custom` needs `date_from` and `date_to`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "7d",
                                "30d",
                                "90d",
                                "12m",
                                "custom"
                            ]
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Start of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "End of a custom period",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations (within the viewer's permissions)",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only these auditors",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "value": {
                                                    "type": "number"
                                                },
                                                "previous": {
                                                    "type": "number"
                                                },
                                                "unit": {
                                                    "type": "string"
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "from": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "to": {
                                                            "type": "string",
                                                            "format": "date"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "kind": "value",
                                        "value": 82.4,
                                        "previous": 79.1,
                                        "unit": "%",
                                        "meta": {
                                            "from": "2026-10-04",
                                            "to": "2026-11-03"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dashboards/{uuid}/widgets/{widget_uuid}/explain": {
            "post": {
                "operationId": "dashboardsAiExplain",
                "summary": "Explain card data (AI)",
                "description": "A short explanation of what the card shows for the acting user's data and filters.",
                "tags": [
                    "Dashboards"
                ],
                "x-mcp-tool": "dashboards_ai_explain",
                "x-plan-feature": "ai",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Dashboard UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "widget_uuid",
                        "in": "path",
                        "required": true,
                        "description": "Card UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "period": {
                                        "type": "string",
                                        "enum": [
                                            "7d",
                                            "30d",
                                            "90d",
                                            "12m",
                                            "custom"
                                        ],
                                        "description": "Period; `custom` needs `date_from` and `date_to`"
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Start of a custom period"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "End of a custom period"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these locations (within the viewer's permissions)"
                                    },
                                    "checklist_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these checklists"
                                    },
                                    "auditor_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Only these auditors"
                                    }
                                }
                            },
                            "example": {
                                "period": "7d",
                                "date_from": "2026-11-01",
                                "date_to": "2026-11-30",
                                "location_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "text": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "text": "The average score grew from 79% to 82%, mostly thanks to Abay Ave."
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/invites": {
            "post": {
                "operationId": "dispatcherInvitesCreate",
                "summary": "Create Telegram connection links",
                "description": "One-time links (valid 7 days) that connect each employee to the dispatcher bot. Send them by your own channel, or connect employees by a QR code with the bot link: an employee shares the phone number and the bot finds them by the profile phone.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_invites_create",
                "x-permissions": [
                    "dispatcher.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Employee ids",
                                        "maxItems": 500
                                    }
                                },
                                "required": [
                                    "user_ids"
                                ]
                            },
                            "example": {
                                "user_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user_id": {
                                                                "type": "integer"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "links": [
                                            {
                                                "user_id": 42,
                                                "url": "https://t.me/jecheck_bot?start=Qm3x8YtK2pZr7Lw0Vn5aBcDe"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/metrics": {
            "get": {
                "operationId": "dispatcherMetrics",
                "summary": "Get dispatcher metrics",
                "description": "Last 7 days and the 7 days before: `reaction_minutes` — median time from a question about audit findings to the answer; `accepted_share` — % of findings accepted within `accept_hours`; `on_time_share` — % of tasks closed on time; `without_manager_share` — % of task questions resolved without a manager; `answered_share` — % of questions answered; `messages` — messages sent. `stale_now` — open tasks without movement for over 7 days; `coverage` — employees with Telegram connected.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_metrics",
                "x-permissions": [
                    "dispatcher.view",
                    "dispatcher.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "current": {
                                                    "type": "object",
                                                    "properties": {
                                                        "reaction_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "accepted_share": {
                                                            "type": "integer"
                                                        },
                                                        "on_time_share": {
                                                            "type": "integer"
                                                        },
                                                        "without_manager_share": {
                                                            "type": "integer"
                                                        },
                                                        "answered_share": {
                                                            "type": "integer"
                                                        },
                                                        "messages": {
                                                            "type": "integer"
                                                        },
                                                        "triage": {
                                                            "type": "integer"
                                                        },
                                                        "closed_tasks": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "previous": {
                                                    "type": "object",
                                                    "properties": {
                                                        "reaction_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "accepted_share": {
                                                            "type": "integer"
                                                        },
                                                        "on_time_share": {
                                                            "type": "integer"
                                                        },
                                                        "without_manager_share": {
                                                            "type": "integer"
                                                        },
                                                        "answered_share": {
                                                            "type": "integer"
                                                        },
                                                        "messages": {
                                                            "type": "integer"
                                                        },
                                                        "triage": {
                                                            "type": "integer"
                                                        },
                                                        "closed_tasks": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "stale_now": {
                                                    "type": "integer"
                                                },
                                                "coverage": {
                                                    "type": "object",
                                                    "properties": {
                                                        "linked": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "current": {
                                            "reaction_minutes": 38,
                                            "accepted_share": 81,
                                            "on_time_share": 74,
                                            "without_manager_share": 88,
                                            "answered_share": 92,
                                            "messages": 146,
                                            "triage": 21,
                                            "closed_tasks": 57
                                        },
                                        "previous": {
                                            "reaction_minutes": 95,
                                            "accepted_share": 62,
                                            "on_time_share": 61,
                                            "without_manager_share": 80,
                                            "answered_share": 85,
                                            "messages": 120,
                                            "triage": 18,
                                            "closed_tasks": 49
                                        },
                                        "stale_now": 6,
                                        "coverage": {
                                            "linked": 34,
                                            "total": 41
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/people": {
            "get": {
                "operationId": "dispatcherPeople",
                "summary": "List employees and their Telegram and Slack connection",
                "description": "Active employees of the company: whether Telegram is connected (`linked`), stopped the bot (`blocked`), whether a phone is set in the profile (needed to connect by sharing the phone number in the bot), and whether the employee was found in the connected Slack workspace (`slack`) — then the dispatcher writes to them in Slack.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_people",
                "x-permissions": [
                    "dispatcher.manage"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "linked",
                        "in": "query",
                        "description": "Only connected (true) or not connected (false) employees",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "linked": {
                                                        "type": "boolean"
                                                    },
                                                    "blocked": {
                                                        "type": "boolean"
                                                    },
                                                    "username": {
                                                        "type": "string"
                                                    },
                                                    "has_phone": {
                                                        "type": "boolean"
                                                    },
                                                    "slack": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "user": {
                                                "id": 42,
                                                "name": "Aliya Sarsenova"
                                            },
                                            "linked": true,
                                            "blocked": false,
                                            "username": "aliya_s",
                                            "has_phone": true,
                                            "slack": false
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/people/{id}/telegram": {
            "delete": {
                "operationId": "dispatcherPeopleUnlink",
                "summary": "Disconnect an employee from Telegram",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_people_unlink",
                "x-permissions": [
                    "dispatcher.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Employee id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "disconnected": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "disconnected": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/settings": {
            "get": {
                "operationId": "dispatcherSettingsGet",
                "summary": "Get dispatcher settings",
                "description": "Whether the dispatcher is on, which duties it performs and its limits. Duties: `task_flow` — asks about stuck/overdue tasks; `audit_triage` — makes sure every audit finding has an owner who accepted it; `fix_verification` — asks reviewers to accept or return fixes, closes tasks when the item passes in a new audit (`close_on_pass`); `haccp_urgent` — critical HACCP deviations; `plan_discipline` — overdue planned audits; `morning_digest` — manager digest; `intake` — requests written to the bot.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_settings_get",
                "x-permissions": [
                    "dispatcher.view",
                    "dispatcher.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "duties": {
                                                    "type": "object",
                                                    "properties": {
                                                        "task_flow": {
                                                            "type": "boolean"
                                                        },
                                                        "audit_triage": {
                                                            "type": "boolean"
                                                        },
                                                        "fix_verification": {
                                                            "type": "boolean"
                                                        },
                                                        "haccp_urgent": {
                                                            "type": "boolean"
                                                        },
                                                        "plan_discipline": {
                                                            "type": "boolean"
                                                        },
                                                        "morning_digest": {
                                                            "type": "boolean"
                                                        },
                                                        "intake": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "stale_days": {
                                                    "type": "integer"
                                                },
                                                "escalate_after": {
                                                    "type": "integer"
                                                },
                                                "accept_hours": {
                                                    "type": "integer"
                                                },
                                                "due_shift_days": {
                                                    "type": "integer"
                                                },
                                                "due_shift_max": {
                                                    "type": "integer"
                                                },
                                                "close_on_pass": {
                                                    "type": "boolean"
                                                },
                                                "haccp_minutes": {
                                                    "type": "integer"
                                                },
                                                "digest_hour": {
                                                    "type": "integer"
                                                },
                                                "work_from": {
                                                    "type": "integer"
                                                },
                                                "work_to": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "enabled": true,
                                        "duties": {
                                            "task_flow": true,
                                            "audit_triage": true,
                                            "fix_verification": true,
                                            "haccp_urgent": true,
                                            "plan_discipline": true,
                                            "morning_digest": true,
                                            "intake": true
                                        },
                                        "stale_days": 3,
                                        "escalate_after": 2,
                                        "accept_hours": 2,
                                        "due_shift_days": 7,
                                        "due_shift_max": 2,
                                        "close_on_pass": true,
                                        "haccp_minutes": 30,
                                        "digest_hour": 8,
                                        "work_from": 9,
                                        "work_to": 20
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "dispatcherSettingsUpdate",
                "summary": "Update dispatcher settings",
                "description": "Partial update: pass only what changes. Numbers are clamped to their allowed ranges. Turning the dispatcher on requires a plan with AI features.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_settings_update",
                "x-permissions": [
                    "dispatcher.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "enabled": {
                                        "type": "boolean",
                                        "description": "Turn the dispatcher on or off"
                                    },
                                    "duties": {
                                        "type": "object",
                                        "properties": {
                                            "task_flow": {
                                                "type": "boolean"
                                            },
                                            "audit_triage": {
                                                "type": "boolean"
                                            },
                                            "fix_verification": {
                                                "type": "boolean"
                                            },
                                            "haccp_urgent": {
                                                "type": "boolean"
                                            },
                                            "plan_discipline": {
                                                "type": "boolean"
                                            },
                                            "morning_digest": {
                                                "type": "boolean"
                                            },
                                            "intake": {
                                                "type": "boolean"
                                            }
                                        },
                                        "description": "Duties to turn on or off"
                                    },
                                    "close_on_pass": {
                                        "type": "boolean",
                                        "description": "Close a task when its item passes in a new audit at the same location"
                                    },
                                    "stale_days": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 14
                                    },
                                    "escalate_after": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 5
                                    },
                                    "accept_hours": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 24
                                    },
                                    "due_shift_days": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 30
                                    },
                                    "due_shift_max": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 5
                                    },
                                    "haccp_minutes": {
                                        "type": "integer",
                                        "minimum": 5,
                                        "maximum": 240
                                    },
                                    "digest_hour": {
                                        "type": "integer",
                                        "minimum": 5,
                                        "maximum": 12
                                    },
                                    "work_from": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                    },
                                    "work_to": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 24
                                    }
                                }
                            },
                            "example": {
                                "enabled": true,
                                "duties": {
                                    "task_flow": true,
                                    "audit_triage": true,
                                    "fix_verification": true
                                },
                                "close_on_pass": true,
                                "stale_days": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "duties": {
                                                    "type": "object",
                                                    "properties": {
                                                        "task_flow": {
                                                            "type": "boolean"
                                                        },
                                                        "audit_triage": {
                                                            "type": "boolean"
                                                        },
                                                        "fix_verification": {
                                                            "type": "boolean"
                                                        },
                                                        "haccp_urgent": {
                                                            "type": "boolean"
                                                        },
                                                        "plan_discipline": {
                                                            "type": "boolean"
                                                        },
                                                        "morning_digest": {
                                                            "type": "boolean"
                                                        },
                                                        "intake": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "stale_days": {
                                                    "type": "integer"
                                                },
                                                "escalate_after": {
                                                    "type": "integer"
                                                },
                                                "accept_hours": {
                                                    "type": "integer"
                                                },
                                                "due_shift_days": {
                                                    "type": "integer"
                                                },
                                                "due_shift_max": {
                                                    "type": "integer"
                                                },
                                                "close_on_pass": {
                                                    "type": "boolean"
                                                },
                                                "haccp_minutes": {
                                                    "type": "integer"
                                                },
                                                "digest_hour": {
                                                    "type": "integer"
                                                },
                                                "work_from": {
                                                    "type": "integer"
                                                },
                                                "work_to": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "enabled": true,
                                        "duties": {
                                            "task_flow": true,
                                            "audit_triage": true,
                                            "fix_verification": true,
                                            "haccp_urgent": true,
                                            "plan_discipline": true,
                                            "morning_digest": true,
                                            "intake": true
                                        },
                                        "stale_days": 3,
                                        "escalate_after": 2,
                                        "accept_hours": 2,
                                        "due_shift_days": 7,
                                        "due_shift_max": 2,
                                        "close_on_pass": true,
                                        "haccp_minutes": 30,
                                        "digest_hour": 8,
                                        "work_from": 9,
                                        "work_to": 20
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/slack": {
            "get": {
                "operationId": "dispatcherSlackGet",
                "summary": "Get the Slack connection",
                "description": "Whether the company connected its Slack workspace to the dispatcher. Employees are matched by email; matched employees get dispatcher messages in Slack instead of Telegram. Connecting needs the Slack sign-in in a browser — open `install_url` while signed in to jeCheck.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_slack_get",
                "x-permissions": [
                    "dispatcher.view"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "available": {
                                                    "type": "boolean"
                                                },
                                                "connected": {
                                                    "type": "boolean"
                                                },
                                                "team": {
                                                    "type": "string"
                                                },
                                                "matched": {
                                                    "type": "integer"
                                                },
                                                "synced_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "install_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "available": true,
                                        "connected": true,
                                        "team": "Harbor & Oak",
                                        "matched": 18,
                                        "synced_at": "2026-11-04T12:10:00+05:00",
                                        "install_url": "https://app.jecheck.io/ui/dispatcher/slack/install"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "dispatcherSlackDisconnect",
                "summary": "Disconnect Slack",
                "description": "Removes the jeCheck app from the Slack workspace; the dispatcher writes to employees in Telegram or via push notifications again.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_slack_disconnect",
                "x-permissions": [
                    "dispatcher.manage"
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "disconnected": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "disconnected": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/slack/sync": {
            "post": {
                "operationId": "dispatcherSlackSync",
                "summary": "Match Slack members to employees again",
                "description": "Re-reads the Slack workspace members and matches them to employees by email (after new hires or email changes).",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_slack_sync",
                "x-permissions": [
                    "dispatcher.manage"
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "matched": {
                                                    "type": "integer"
                                                },
                                                "members": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "matched": 18,
                                        "members": 24
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/threads": {
            "get": {
                "operationId": "dispatcherThreadsList",
                "summary": "List dispatcher conversations",
                "description": "Conversations of the dispatcher about one item each (a task, an audit, a HACCP deviation, a planned audit, a request), newest first. `reason` (why the assignee is blocked or says the task is not theirs) is returned only with the `dispatcher.messages` permission.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_threads_list",
                "x-permissions": [
                    "dispatcher.view",
                    "dispatcher.manage"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "duty",
                        "in": "query",
                        "description": "Only this duty",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "task_flow",
                                "audit_triage",
                                "fix_verification",
                                "haccp_urgent",
                                "plan_discipline",
                                "morning_digest",
                                "intake"
                            ]
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "Only this state",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "waiting",
                                "escalated",
                                "done",
                                "closed"
                            ]
                        }
                    },
                    {
                        "name": "subject_type",
                        "in": "query",
                        "description": "Only conversations about this kind of item",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "task",
                                "audit",
                                "haccp",
                                "plan",
                                "intake"
                            ]
                        }
                    },
                    {
                        "name": "subject_id",
                        "in": "query",
                        "description": "Only conversations about this item (with subject_type)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Only conversations with this employee",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "duty": {
                                                        "type": "string"
                                                    },
                                                    "subject_type": {
                                                        "type": "string"
                                                    },
                                                    "subject_id": {
                                                        "type": "integer"
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "role": {
                                                        "type": "string"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    },
                                                    "awaiting": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "attempts": {
                                                        "type": "integer"
                                                    },
                                                    "escalation_level": {
                                                        "type": "integer"
                                                    },
                                                    "next_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "answered_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "reason": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 512,
                                            "duty": "task_flow",
                                            "subject_type": "task",
                                            "subject_id": 88231,
                                            "user": {
                                                "id": 42,
                                                "name": "Aliya Sarsenova"
                                            },
                                            "role": "executor",
                                            "state": "waiting",
                                            "awaiting": null,
                                            "attempts": 1,
                                            "escalation_level": 0,
                                            "next_at": "2026-11-08T09:00:00+05:00",
                                            "answered_at": "2026-11-04T11:20:00+05:00",
                                            "created_at": "2026-11-04T11:02:00+05:00",
                                            "updated_at": "2026-11-04T11:20:00+05:00",
                                            "reason": "Waiting for the supplier to deliver a new seal"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dispatcher/threads/{id}": {
            "get": {
                "operationId": "dispatcherThreadsGet",
                "summary": "Retrieve a conversation",
                "description": "A conversation with its messages. Message texts are returned only with the `dispatcher.messages` permission (each view is recorded in the access log); otherwise `messages` is null.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_threads_get",
                "x-permissions": [
                    "dispatcher.view",
                    "dispatcher.manage"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Conversation id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "duty": {
                                                    "type": "string"
                                                },
                                                "subject_type": {
                                                    "type": "string"
                                                },
                                                "subject_id": {
                                                    "type": "integer"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "awaiting": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "escalation_level": {
                                                    "type": "integer"
                                                },
                                                "next_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "answered_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "reason": {
                                                    "type": "string"
                                                },
                                                "messages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "direction": {
                                                                "type": "string"
                                                            },
                                                            "channel": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "buttons": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "text": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "sent_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "button": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 512,
                                        "duty": "task_flow",
                                        "subject_type": "task",
                                        "subject_id": 88231,
                                        "user": {
                                            "id": 42,
                                            "name": "Aliya Sarsenova"
                                        },
                                        "role": "executor",
                                        "state": "waiting",
                                        "awaiting": null,
                                        "attempts": 1,
                                        "escalation_level": 0,
                                        "next_at": "2026-11-08T09:00:00+05:00",
                                        "answered_at": "2026-11-04T11:20:00+05:00",
                                        "created_at": "2026-11-04T11:02:00+05:00",
                                        "updated_at": "2026-11-04T11:20:00+05:00",
                                        "reason": "Waiting for the supplier to deliver a new seal",
                                        "messages": [
                                            {
                                                "id": 9001,
                                                "direction": "out",
                                                "channel": "telegram",
                                                "status": "sent",
                                                "text": "The task is 2 days overdue.",
                                                "buttons": [
                                                    [
                                                        {
                                                            "text": "Done"
                                                        },
                                                        {
                                                            "text": "Need more time"
                                                        }
                                                    ]
                                                ],
                                                "sent_at": "2026-11-04T11:02:00+05:00"
                                            },
                                            {
                                                "id": 9002,
                                                "direction": "in",
                                                "channel": "telegram",
                                                "status": "received",
                                                "text": null,
                                                "buttons": null,
                                                "button": "time",
                                                "sent_at": "2026-11-04T11:19:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/feedback/appeals": {
            "get": {
                "operationId": "feedbackAppealsList",
                "summary": "List customer appeals",
                "description": "Conversations started by customers in the company Telegram or WhatsApp bot, newest first, with the last message. Contains customer contacts, so `appeals.view` is required.",
                "tags": [
                    "Guest feedback"
                ],
                "x-mcp-tool": "feedback_appeals_list",
                "x-permissions": [
                    "appeals.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "closed"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "contact": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "phone": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "email": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "channel": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "assignee": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_message": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "author": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 340,
                                            "title": "Lost umbrella",
                                            "status": "open",
                                            "contact": {
                                                "id": 77,
                                                "name": "Marat",
                                                "phone": null,
                                                "email": null,
                                                "channel": "telegram"
                                            },
                                            "assignee": null,
                                            "last_message": {
                                                "id": 5521,
                                                "author": {
                                                    "type": "customer",
                                                    "id": 77,
                                                    "uuid": null,
                                                    "name": "Marat"
                                                },
                                                "type": "text",
                                                "text": "Hello! I left my umbrella at Abay Ave yesterday.",
                                                "file": null,
                                                "created_at": "2026-11-03T09:12:00+05:00"
                                            },
                                            "created_at": "2026-11-03T09:12:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/feedback/appeals/{id}": {
            "get": {
                "operationId": "feedbackAppealsGet",
                "summary": "Retrieve a customer appeal",
                "description": "The appeal with the whole conversation, oldest message first.",
                "tags": [
                    "Guest feedback"
                ],
                "x-mcp-tool": "feedback_appeals_get",
                "x-permissions": [
                    "appeals.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Appeal id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "contact": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "channel": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "assignee": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_message": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "author": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "text": {
                                                            "type": "string"
                                                        },
                                                        "file": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "messages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "author": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 340,
                                        "title": "Lost umbrella",
                                        "status": "open",
                                        "contact": {
                                            "id": 77,
                                            "name": "Marat",
                                            "phone": null,
                                            "email": null,
                                            "channel": "telegram"
                                        },
                                        "assignee": null,
                                        "last_message": {
                                            "id": 5521,
                                            "author": {
                                                "type": "customer",
                                                "id": 77,
                                                "uuid": null,
                                                "name": "Marat"
                                            },
                                            "type": "text",
                                            "text": "Hello! I left my umbrella at Abay Ave yesterday.",
                                            "file": null,
                                            "created_at": "2026-11-03T09:12:00+05:00"
                                        },
                                        "created_at": "2026-11-03T09:12:00+05:00",
                                        "messages": [
                                            {
                                                "id": 5521,
                                                "author": {
                                                    "type": "customer",
                                                    "id": 77,
                                                    "uuid": null,
                                                    "name": "Marat"
                                                },
                                                "type": "text",
                                                "text": "Hello! I left my umbrella at Abay Ave yesterday.",
                                                "file": null,
                                                "created_at": "2026-11-03T09:12:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/feedback/appeals/{id}/messages": {
            "post": {
                "operationId": "feedbackAppealsReply",
                "summary": "Reply to a customer appeal",
                "description": "Sends a text message to the customer through the channel of the appeal (Telegram bot or WhatsApp) on behalf of the acting user. Returns the updated conversation.",
                "tags": [
                    "Guest feedback"
                ],
                "x-mcp-tool": "feedback_appeals_reply",
                "x-permissions": [
                    "appeals.view"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Appeal id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "description": "Message text",
                                        "minLength": 1,
                                        "maxLength": 4000
                                    }
                                },
                                "required": [
                                    "text"
                                ]
                            },
                            "example": {
                                "text": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "contact": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "channel": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "assignee": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_message": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "author": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "text": {
                                                            "type": "string"
                                                        },
                                                        "file": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "messages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "author": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 340,
                                        "title": "Lost umbrella",
                                        "status": "open",
                                        "contact": {
                                            "id": 77,
                                            "name": "Marat",
                                            "phone": null,
                                            "email": null,
                                            "channel": "telegram"
                                        },
                                        "assignee": null,
                                        "last_message": {
                                            "id": 5521,
                                            "author": {
                                                "type": "customer",
                                                "id": 77,
                                                "uuid": null,
                                                "name": "Marat"
                                            },
                                            "type": "text",
                                            "text": "Hello! I left my umbrella at Abay Ave yesterday.",
                                            "file": null,
                                            "created_at": "2026-11-03T09:12:00+05:00"
                                        },
                                        "created_at": "2026-11-03T09:12:00+05:00",
                                        "messages": [
                                            {
                                                "id": 5521,
                                                "author": {
                                                    "type": "customer",
                                                    "id": 77,
                                                    "uuid": null,
                                                    "name": "Marat"
                                                },
                                                "type": "text",
                                                "text": "Hello! I left my umbrella at Abay Ave yesterday.",
                                                "file": null,
                                                "created_at": "2026-11-03T09:12:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/feedback/reviews": {
            "get": {
                "operationId": "feedbackReviewsList",
                "summary": "List guest reviews",
                "description": "Reviews of the locations where `reviews.view` applies, newest first, with stars and sentiment (`positive`, `neutral`, `negative`, `mixed`).",
                "tags": [
                    "Guest feedback"
                ],
                "x-mcp-tool": "feedback_reviews_list",
                "x-permissions": [
                    "reviews.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Created from (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Created to (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "description": "Review source: YandexMaps, TwoGis, TripAdvisor, DeliveryClub, GoogleMaps",
                        "schema": {
                            "type": "string",
                            "maxLength": 64
                        }
                    },
                    {
                        "name": "stars_min",
                        "in": "query",
                        "description": "Minimum stars",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 5
                        }
                    },
                    {
                        "name": "stars_max",
                        "in": "query",
                        "description": "Maximum stars",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 5
                        }
                    },
                    {
                        "name": "sentiment",
                        "in": "query",
                        "description": "Overall sentiment",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "positive",
                                "neutral",
                                "negative",
                                "mixed"
                            ]
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search in review text and author name",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "stars": {
                                                        "type": "integer"
                                                    },
                                                    "text": {
                                                        "type": "string"
                                                    },
                                                    "author_name": {
                                                        "type": "string"
                                                    },
                                                    "source": {
                                                        "type": "string"
                                                    },
                                                    "sentiment": {
                                                        "type": "string"
                                                    },
                                                    "sentiment_scores": {
                                                        "type": "object",
                                                        "properties": {
                                                            "positive": {
                                                                "type": "number"
                                                            },
                                                            "neutral": {
                                                                "type": "number"
                                                            },
                                                            "negative": {
                                                                "type": "number"
                                                            }
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1683,
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "stars": 2,
                                            "text": "Coffee was great but we waited 25 minutes for a table.",
                                            "author_name": "Olga V.",
                                            "source": "TwoGis",
                                            "sentiment": "mixed",
                                            "sentiment_scores": {
                                                "positive": 0.41,
                                                "neutral": 0.05,
                                                "negative": 0.54
                                            },
                                            "created_at": "2026-11-02T19:01:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/feedback/reviews/stats": {
            "get": {
                "operationId": "feedbackReviewsStats",
                "summary": "Get review statistics by location",
                "description": "Number of reviews, average stars and sentiment split per location for the period, plus the total.",
                "tags": [
                    "Guest feedback"
                ],
                "x-mcp-tool": "feedback_reviews_stats",
                "x-permissions": [
                    "reviews.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Created from (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Created to (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "description": "Review source: YandexMaps, TwoGis, TripAdvisor, DeliveryClub, GoogleMaps",
                        "schema": {
                            "type": "string",
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "total": {
                                                    "type": "object",
                                                    "properties": {
                                                        "reviews": {
                                                            "type": "integer"
                                                        },
                                                        "avg_stars": {
                                                            "type": "number"
                                                        },
                                                        "positive": {
                                                            "type": "integer"
                                                        },
                                                        "neutral": {
                                                            "type": "integer"
                                                        },
                                                        "negative": {
                                                            "type": "integer"
                                                        },
                                                        "mixed": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "reviews": {
                                                                "type": "integer"
                                                            },
                                                            "avg_stars": {
                                                                "type": "number"
                                                            },
                                                            "positive": {
                                                                "type": "integer"
                                                            },
                                                            "neutral": {
                                                                "type": "integer"
                                                            },
                                                            "negative": {
                                                                "type": "integer"
                                                            },
                                                            "mixed": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "total": {
                                            "reviews": 132,
                                            "avg_stars": 4.3,
                                            "positive": 88,
                                            "neutral": 12,
                                            "negative": 21,
                                            "mixed": 11
                                        },
                                        "locations": [
                                            {
                                                "location": {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                "reviews": 70,
                                                "avg_stars": 4.5,
                                                "positive": 51,
                                                "neutral": 6,
                                                "negative": 8,
                                                "mixed": 5
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/feedback/reviews/{id}": {
            "get": {
                "operationId": "feedbackReviewsGet",
                "summary": "Retrieve a guest review",
                "description": "Review with sentence-level sentiment.",
                "tags": [
                    "Guest feedback"
                ],
                "x-mcp-tool": "feedback_reviews_get",
                "x-permissions": [
                    "reviews.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Review id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "stars": {
                                                    "type": "integer"
                                                },
                                                "text": {
                                                    "type": "string"
                                                },
                                                "author_name": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "sentiment": {
                                                    "type": "string"
                                                },
                                                "sentiment_scores": {
                                                    "type": "object",
                                                    "properties": {
                                                        "positive": {
                                                            "type": "number"
                                                        },
                                                        "neutral": {
                                                            "type": "number"
                                                        },
                                                        "negative": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "sentences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "sentiment": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 1683,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "stars": 2,
                                        "text": "Coffee was great but we waited 25 minutes for a table.",
                                        "author_name": "Olga V.",
                                        "source": "TwoGis",
                                        "sentiment": "mixed",
                                        "sentiment_scores": {
                                            "positive": 0.41,
                                            "neutral": 0.05,
                                            "negative": 0.54
                                        },
                                        "created_at": "2026-11-02T19:01:00+05:00",
                                        "sentences": [
                                            {
                                                "text": "Coffee was great",
                                                "sentiment": "positive"
                                            },
                                            {
                                                "text": "but we waited 25 minutes for a table.",
                                                "sentiment": "negative"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/deviations": {
            "get": {
                "operationId": "haccpDeviationsList",
                "summary": "List HACCP deviations",
                "description": "Deviations at the visible locations: reviews first, then newest. `status=open` (default) — all unresolved (stages `open`, `correcting`, `review`); `closed`; `all`. Use `stage` for an exact stage.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_list",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "closed",
                                "all"
                            ],
                            "default": "open"
                        }
                    },
                    {
                        "name": "stage",
                        "in": "query",
                        "description": "Exact stage",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "correcting",
                                "review",
                                "closed"
                            ]
                        }
                    },
                    {
                        "name": "severity",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "critical",
                                "major",
                                "minor"
                            ]
                        }
                    },
                    {
                        "name": "journal_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "overdue",
                        "in": "query",
                        "description": "Only unresolved deviations past their due time",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Opened from (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Opened to (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only deviations changed after this moment",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "journal": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "object": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "severity": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "breaches": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "key": {
                                                                    "type": "string"
                                                                },
                                                                "label": {
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                },
                                                                "unit": {
                                                                    "type": "string"
                                                                },
                                                                "min": {
                                                                    "type": "integer"
                                                                },
                                                                "max": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "responsible": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "due_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "overdue": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "closed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 5120,
                                            "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                            "journal": {
                                                "id": 14,
                                                "title": "Storage temperature"
                                            },
                                            "location": {
                                                "id": 4609,
                                                "name": "Abay Ave"
                                            },
                                            "object": {
                                                "id": 301,
                                                "name": "Fridge #1"
                                            },
                                            "severity": "major",
                                            "status": "correcting",
                                            "breaches": [
                                                {
                                                    "key": "temperature",
                                                    "label": "Temperature",
                                                    "value": 8.4,
                                                    "unit": "°C",
                                                    "min": 2,
                                                    "max": 6
                                                }
                                            ],
                                            "responsible": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "due_at": "2026-11-04T09:02:00+05:00",
                                            "overdue": false,
                                            "created_at": "2026-11-03T09:02:05+05:00",
                                            "closed_at": null,
                                            "updated_at": "2026-11-03T09:40:00+05:00",
                                            "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/deviations/{uuid}": {
            "get": {
                "operationId": "haccpDeviationsGet",
                "summary": "Retrieve a HACCP deviation",
                "description": "Deviation card: breached limits, the original entry and the re-check, corrective actions, required fields before submitting, the follow-up task and whether the token can work on / verify it.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_get",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Deviation UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "severity": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "breaches": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "number"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "overdue": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "correction": {
                                                    "type": "string"
                                                },
                                                "product_disposition": {
                                                    "type": "string"
                                                },
                                                "product_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "root_cause": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preventive_action": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "required": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "entry": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recheck": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "closed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verify_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "can_work": {
                                                    "type": "boolean"
                                                },
                                                "can_verify": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5120,
                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "journal": {
                                            "id": 14,
                                            "title": "Storage temperature"
                                        },
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object": {
                                            "id": 301,
                                            "name": "Fridge #1"
                                        },
                                        "severity": "major",
                                        "status": "correcting",
                                        "breaches": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "value": 8.4,
                                                "unit": "°C",
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "responsible": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "due_at": "2026-11-04T09:02:00+05:00",
                                        "overdue": false,
                                        "created_at": "2026-11-03T09:02:05+05:00",
                                        "closed_at": null,
                                        "updated_at": "2026-11-03T09:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "correction": "Products moved to the backup fridge, door seal replaced",
                                        "product_disposition": "released",
                                        "product_note": null,
                                        "root_cause": null,
                                        "preventive_action": null,
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/c3d4.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/c3d4.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "required": [
                                            "correction",
                                            "product_disposition"
                                        ],
                                        "entry": {
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "comment": "Door was left open"
                                        },
                                        "recheck": {
                                            "uuid": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
                                            "status": "ok",
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        },
                                        "task": {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "title": "Fix the deviation: Storage temperature",
                                            "status": "in_progress"
                                        },
                                        "closed_by": null,
                                        "verified_by": null,
                                        "verified_at": null,
                                        "verify_note": null,
                                        "can_work": true,
                                        "can_verify": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "haccpDeviationsUpdate",
                "summary": "Update corrective actions",
                "description": "Saves corrective actions as a draft (stage moves to `correcting`). Allowed to the responsible person or with `haccp.resolve` at the location; `responsible_user_id` — with `haccp.resolve` only.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_update",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Deviation UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "correction": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "What was done to fix it",
                                        "maxLength": 5000
                                    },
                                    "product_disposition": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "released",
                                            "reworked",
                                            "destroyed",
                                            "returned",
                                            "quarantine",
                                            "not_applicable"
                                        ],
                                        "description": "What happened to the product"
                                    },
                                    "product_note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "root_cause": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Root cause (required for critical deviations)",
                                        "maxLength": 5000
                                    },
                                    "preventive_action": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Preventive action (required for critical deviations)",
                                        "maxLength": 5000
                                    },
                                    "photos": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Paths from `haccp.media.upload`",
                                        "maxItems": 10
                                    },
                                    "responsible_user_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                }
                            },
                            "example": {
                                "correction": "string",
                                "product_disposition": "released",
                                "product_note": "string",
                                "root_cause": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "severity": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "breaches": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "number"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "overdue": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "correction": {
                                                    "type": "string"
                                                },
                                                "product_disposition": {
                                                    "type": "string"
                                                },
                                                "product_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "root_cause": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preventive_action": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "required": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "entry": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recheck": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "closed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verify_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "can_work": {
                                                    "type": "boolean"
                                                },
                                                "can_verify": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5120,
                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "journal": {
                                            "id": 14,
                                            "title": "Storage temperature"
                                        },
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object": {
                                            "id": 301,
                                            "name": "Fridge #1"
                                        },
                                        "severity": "major",
                                        "status": "correcting",
                                        "breaches": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "value": 8.4,
                                                "unit": "°C",
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "responsible": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "due_at": "2026-11-04T09:02:00+05:00",
                                        "overdue": false,
                                        "created_at": "2026-11-03T09:02:05+05:00",
                                        "closed_at": null,
                                        "updated_at": "2026-11-03T09:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "correction": "Products moved to the backup fridge, door seal replaced",
                                        "product_disposition": "released",
                                        "product_note": null,
                                        "root_cause": null,
                                        "preventive_action": null,
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/c3d4.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/c3d4.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "required": [
                                            "correction",
                                            "product_disposition"
                                        ],
                                        "entry": {
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "comment": "Door was left open"
                                        },
                                        "recheck": {
                                            "uuid": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
                                            "status": "ok",
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        },
                                        "task": {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "title": "Fix the deviation: Storage temperature",
                                            "status": "in_progress"
                                        },
                                        "closed_by": null,
                                        "verified_by": null,
                                        "verified_at": null,
                                        "verify_note": null,
                                        "can_work": true,
                                        "can_verify": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/deviations/{uuid}/close": {
            "post": {
                "operationId": "haccpDeviationsClose",
                "summary": "Close a HACCP deviation",
                "description": "Verifies corrective actions and closes the deviation. Requires `haccp.resolve` at the location; critical deviations — `haccp.close_critical`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_close",
                "x-permissions": [
                    "haccp.resolve",
                    "haccp.close_critical"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Deviation UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Verification note",
                                        "maxLength": 2000
                                    }
                                }
                            },
                            "example": {
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "severity": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "breaches": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "number"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "overdue": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "correction": {
                                                    "type": "string"
                                                },
                                                "product_disposition": {
                                                    "type": "string"
                                                },
                                                "product_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "root_cause": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preventive_action": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "required": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "entry": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recheck": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "closed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verify_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "can_work": {
                                                    "type": "boolean"
                                                },
                                                "can_verify": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5120,
                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "journal": {
                                            "id": 14,
                                            "title": "Storage temperature"
                                        },
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object": {
                                            "id": 301,
                                            "name": "Fridge #1"
                                        },
                                        "severity": "major",
                                        "status": "correcting",
                                        "breaches": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "value": 8.4,
                                                "unit": "°C",
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "responsible": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "due_at": "2026-11-04T09:02:00+05:00",
                                        "overdue": false,
                                        "created_at": "2026-11-03T09:02:05+05:00",
                                        "closed_at": null,
                                        "updated_at": "2026-11-03T09:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "correction": "Products moved to the backup fridge, door seal replaced",
                                        "product_disposition": "released",
                                        "product_note": null,
                                        "root_cause": null,
                                        "preventive_action": null,
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/c3d4.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/c3d4.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "required": [
                                            "correction",
                                            "product_disposition"
                                        ],
                                        "entry": {
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "comment": "Door was left open"
                                        },
                                        "recheck": {
                                            "uuid": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
                                            "status": "ok",
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        },
                                        "task": {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "title": "Fix the deviation: Storage temperature",
                                            "status": "in_progress"
                                        },
                                        "closed_by": null,
                                        "verified_by": null,
                                        "verified_at": null,
                                        "verify_note": null,
                                        "can_work": true,
                                        "can_verify": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/deviations/{uuid}/reject": {
            "post": {
                "operationId": "haccpDeviationsReject",
                "summary": "Return a HACCP deviation for rework",
                "description": "Returns a deviation in `review` back to correction with a note. Same permissions as closing.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_reject",
                "x-permissions": [
                    "haccp.resolve",
                    "haccp.close_critical"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Deviation UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "note"
                                ]
                            },
                            "example": {
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "severity": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "breaches": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "number"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "overdue": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "correction": {
                                                    "type": "string"
                                                },
                                                "product_disposition": {
                                                    "type": "string"
                                                },
                                                "product_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "root_cause": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preventive_action": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "required": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "entry": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recheck": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "closed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verify_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "can_work": {
                                                    "type": "boolean"
                                                },
                                                "can_verify": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5120,
                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "journal": {
                                            "id": 14,
                                            "title": "Storage temperature"
                                        },
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object": {
                                            "id": 301,
                                            "name": "Fridge #1"
                                        },
                                        "severity": "major",
                                        "status": "correcting",
                                        "breaches": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "value": 8.4,
                                                "unit": "°C",
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "responsible": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "due_at": "2026-11-04T09:02:00+05:00",
                                        "overdue": false,
                                        "created_at": "2026-11-03T09:02:05+05:00",
                                        "closed_at": null,
                                        "updated_at": "2026-11-03T09:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "correction": "Products moved to the backup fridge, door seal replaced",
                                        "product_disposition": "released",
                                        "product_note": null,
                                        "root_cause": null,
                                        "preventive_action": null,
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/c3d4.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/c3d4.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "required": [
                                            "correction",
                                            "product_disposition"
                                        ],
                                        "entry": {
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "comment": "Door was left open"
                                        },
                                        "recheck": {
                                            "uuid": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
                                            "status": "ok",
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        },
                                        "task": {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "title": "Fix the deviation: Storage temperature",
                                            "status": "in_progress"
                                        },
                                        "closed_by": null,
                                        "verified_by": null,
                                        "verified_at": null,
                                        "verify_note": null,
                                        "can_work": true,
                                        "can_verify": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/deviations/{uuid}/submit": {
            "post": {
                "operationId": "haccpDeviationsSubmit",
                "summary": "Submit corrective actions for review",
                "description": "Sends the deviation to review when the required fields are filled. If the token itself may close it (`haccp.resolve`, or `haccp.close_critical` for critical ones), it is closed right away.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_submit",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Deviation UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "severity": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "breaches": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "number"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "overdue": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "correction": {
                                                    "type": "string"
                                                },
                                                "product_disposition": {
                                                    "type": "string"
                                                },
                                                "product_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "root_cause": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preventive_action": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "required": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "entry": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recheck": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "closed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verify_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "can_work": {
                                                    "type": "boolean"
                                                },
                                                "can_verify": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5120,
                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "journal": {
                                            "id": 14,
                                            "title": "Storage temperature"
                                        },
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object": {
                                            "id": 301,
                                            "name": "Fridge #1"
                                        },
                                        "severity": "major",
                                        "status": "correcting",
                                        "breaches": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "value": 8.4,
                                                "unit": "°C",
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "responsible": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "due_at": "2026-11-04T09:02:00+05:00",
                                        "overdue": false,
                                        "created_at": "2026-11-03T09:02:05+05:00",
                                        "closed_at": null,
                                        "updated_at": "2026-11-03T09:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "correction": "Products moved to the backup fridge, door seal replaced",
                                        "product_disposition": "released",
                                        "product_note": null,
                                        "root_cause": null,
                                        "preventive_action": null,
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/c3d4.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/c3d4.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "required": [
                                            "correction",
                                            "product_disposition"
                                        ],
                                        "entry": {
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "comment": "Door was left open"
                                        },
                                        "recheck": {
                                            "uuid": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
                                            "status": "ok",
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        },
                                        "task": {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "title": "Fix the deviation: Storage temperature",
                                            "status": "in_progress"
                                        },
                                        "closed_by": null,
                                        "verified_by": null,
                                        "verified_at": null,
                                        "verify_note": null,
                                        "can_work": true,
                                        "can_verify": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/deviations/{uuid}/task": {
            "post": {
                "operationId": "haccpDeviationsTask",
                "summary": "Create a task for a HACCP deviation",
                "description": "Creates a task when the fix needs work (repair, deep cleaning). Assign to a user (`assignee_id`) or a team queue (`team_id`). Requires `haccp.resolve` at the location.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_deviations_task",
                "x-permissions": [
                    "haccp.resolve"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Deviation UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "assignee_id": {
                                        "type": "integer",
                                        "description": "Executor (user id)"
                                    },
                                    "team_id": {
                                        "type": "integer",
                                        "description": "Team id instead of a user"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Default: \"Fix the deviation: <journal>\"",
                                        "maxLength": 500
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 5000
                                    },
                                    "due_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "description": "Default: +4 h for critical, +24 h otherwise"
                                    }
                                }
                            },
                            "example": {
                                "assignee_id": 42,
                                "team_id": 42,
                                "title": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "severity": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "breaches": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "number"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "responsible": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "overdue": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "correction": {
                                                    "type": "string"
                                                },
                                                "product_disposition": {
                                                    "type": "string"
                                                },
                                                "product_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "root_cause": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preventive_action": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "required": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "entry": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recheck": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "closed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verified_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "verify_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "can_work": {
                                                    "type": "boolean"
                                                },
                                                "can_verify": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 5120,
                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "journal": {
                                            "id": 14,
                                            "title": "Storage temperature"
                                        },
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object": {
                                            "id": 301,
                                            "name": "Fridge #1"
                                        },
                                        "severity": "major",
                                        "status": "correcting",
                                        "breaches": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "value": 8.4,
                                                "unit": "°C",
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "responsible": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "due_at": "2026-11-04T09:02:00+05:00",
                                        "overdue": false,
                                        "created_at": "2026-11-03T09:02:05+05:00",
                                        "closed_at": null,
                                        "updated_at": "2026-11-03T09:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/haccp/deviations?open=0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "correction": "Products moved to the backup fridge, door seal replaced",
                                        "product_disposition": "released",
                                        "product_note": null,
                                        "root_cause": null,
                                        "preventive_action": null,
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/c3d4.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/c3d4.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "required": [
                                            "correction",
                                            "product_disposition"
                                        ],
                                        "entry": {
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "comment": "Door was left open"
                                        },
                                        "recheck": {
                                            "uuid": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
                                            "status": "ok",
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        },
                                        "task": {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "title": "Fix the deviation: Storage temperature",
                                            "status": "in_progress"
                                        },
                                        "closed_by": null,
                                        "verified_by": null,
                                        "verified_at": null,
                                        "verify_note": null,
                                        "can_work": true,
                                        "can_verify": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/entries": {
            "get": {
                "operationId": "haccpEntriesList",
                "summary": "List HACCP journal entries",
                "description": "Entries at the visible locations, newest first. Archived entries (past the retention period) are not returned; voided entries are included only with `voided=true`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_entries_list",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "journal_id",
                        "in": "query",
                        "description": "Only this journal",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "object_id",
                        "in": "query",
                        "description": "Only this object (fridge, freezer, …)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ok",
                                "warning",
                                "deviation"
                            ]
                        }
                    },
                    {
                        "name": "late",
                        "in": "query",
                        "description": "Only entries recorded late",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "voided",
                        "in": "query",
                        "description": "`true` — only voided entries",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "recorded_from",
                        "in": "query",
                        "description": "Measurement time from",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "recorded_to",
                        "in": "query",
                        "description": "Measurement time to",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only entries changed after this moment — use for incremental sync",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "journal_id": {
                                                        "type": "integer"
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "object_id": {
                                                        "type": "integer"
                                                    },
                                                    "subject_user": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "recorded_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "values": {
                                                        "type": "object",
                                                        "properties": {
                                                            "temperature": {
                                                                "type": "number"
                                                            }
                                                        }
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "flags": {
                                                        "type": "object",
                                                        "properties": {
                                                            "breaches": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "label": {
                                                                            "type": "string"
                                                                        },
                                                                        "value": {
                                                                            "type": "number"
                                                                        },
                                                                        "unit": {
                                                                            "type": "string"
                                                                        },
                                                                        "min": {
                                                                            "type": "integer"
                                                                        },
                                                                        "max": {
                                                                            "type": "integer"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "warnings": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    },
                                                    "late": {
                                                        "type": "boolean"
                                                    },
                                                    "late_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "comment": {
                                                        "type": "string"
                                                    },
                                                    "photos": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "path": {
                                                                    "type": "string"
                                                                },
                                                                "url": {
                                                                    "type": "string",
                                                                    "format": "uri"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "deviation_uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "source": {
                                                        "type": "string"
                                                    },
                                                    "revision": {
                                                        "type": "integer"
                                                    },
                                                    "voided": {
                                                        "type": "boolean"
                                                    },
                                                    "void_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 88231,
                                            "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                            "journal_id": 14,
                                            "location": {
                                                "id": 4609,
                                                "name": "Abay Ave"
                                            },
                                            "object_id": 301,
                                            "subject_user": null,
                                            "user": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "recorded_at": "2026-11-03T09:02:00+05:00",
                                            "values": {
                                                "temperature": 8.4
                                            },
                                            "status": "deviation",
                                            "flags": {
                                                "breaches": [
                                                    {
                                                        "key": "temperature",
                                                        "label": "Temperature",
                                                        "value": 8.4,
                                                        "unit": "°C",
                                                        "min": 2,
                                                        "max": 6
                                                    }
                                                ],
                                                "warnings": []
                                            },
                                            "late": false,
                                            "late_reason": null,
                                            "comment": "Door was left open",
                                            "photos": [
                                                {
                                                    "path": "haccp/761/photos/2026/11/a1b2.jpg",
                                                    "url": "https://storage.example.com/haccp/761/photos/2026/11/a1b2.jpg?X-Amz-Signature=…"
                                                }
                                            ],
                                            "deviation_uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                            "source": "app",
                                            "revision": 0,
                                            "voided": false,
                                            "void_reason": null,
                                            "updated_at": "2026-11-03T09:02:05+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/entries/{id}/revise": {
            "post": {
                "operationId": "haccpEntriesRevise",
                "summary": "Correct a HACCP journal entry",
                "description": "Corrects values of an entry with a reason; previous values stay in the revision history. Allowed to the author or with `haccp.resolve` at the location.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_entries_revise",
                "x-permissions": [
                    "haccp.fill",
                    "haccp.resolve"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Entry id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "values": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true
                                    },
                                    "reason": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "values",
                                    "reason"
                                ]
                            },
                            "example": {
                                "values": [],
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal_id": {
                                                    "type": "integer"
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object_id": {
                                                    "type": "integer"
                                                },
                                                "subject_user": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recorded_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "values": {
                                                    "type": "object",
                                                    "properties": {
                                                        "temperature": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "flags": {
                                                    "type": "object",
                                                    "properties": {
                                                        "breaches": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "value": {
                                                                        "type": "number"
                                                                    },
                                                                    "unit": {
                                                                        "type": "string"
                                                                    },
                                                                    "min": {
                                                                        "type": "integer"
                                                                    },
                                                                    "max": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "warnings": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "late": {
                                                    "type": "boolean"
                                                },
                                                "late_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "comment": {
                                                    "type": "string"
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "deviation_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "revision": {
                                                    "type": "integer"
                                                },
                                                "voided": {
                                                    "type": "boolean"
                                                },
                                                "void_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 88231,
                                        "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                        "journal_id": 14,
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object_id": 301,
                                        "subject_user": null,
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "recorded_at": "2026-11-03T09:02:00+05:00",
                                        "values": {
                                            "temperature": 8.4
                                        },
                                        "status": "deviation",
                                        "flags": {
                                            "breaches": [
                                                {
                                                    "key": "temperature",
                                                    "label": "Temperature",
                                                    "value": 8.4,
                                                    "unit": "°C",
                                                    "min": 2,
                                                    "max": 6
                                                }
                                            ],
                                            "warnings": []
                                        },
                                        "late": false,
                                        "late_reason": null,
                                        "comment": "Door was left open",
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/a1b2.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/a1b2.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "deviation_uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "source": "app",
                                        "revision": 0,
                                        "voided": false,
                                        "void_reason": null,
                                        "updated_at": "2026-11-03T09:02:05+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/entries/{id}/void": {
            "post": {
                "operationId": "haccpEntriesVoid",
                "summary": "Void a HACCP journal entry",
                "description": "Marks an entry as void with a reason (`haccp.resolve` at the location). The entry stays in the journal for the record.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_entries_void",
                "x-permissions": [
                    "haccp.resolve"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Entry id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "reason"
                                ]
                            },
                            "example": {
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal_id": {
                                                    "type": "integer"
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object_id": {
                                                    "type": "integer"
                                                },
                                                "subject_user": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recorded_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "values": {
                                                    "type": "object",
                                                    "properties": {
                                                        "temperature": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "flags": {
                                                    "type": "object",
                                                    "properties": {
                                                        "breaches": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "value": {
                                                                        "type": "number"
                                                                    },
                                                                    "unit": {
                                                                        "type": "string"
                                                                    },
                                                                    "min": {
                                                                        "type": "integer"
                                                                    },
                                                                    "max": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "warnings": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "late": {
                                                    "type": "boolean"
                                                },
                                                "late_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "comment": {
                                                    "type": "string"
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "deviation_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "revision": {
                                                    "type": "integer"
                                                },
                                                "voided": {
                                                    "type": "boolean"
                                                },
                                                "void_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 88231,
                                        "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                        "journal_id": 14,
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object_id": 301,
                                        "subject_user": null,
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "recorded_at": "2026-11-03T09:02:00+05:00",
                                        "values": {
                                            "temperature": 8.4
                                        },
                                        "status": "deviation",
                                        "flags": {
                                            "breaches": [
                                                {
                                                    "key": "temperature",
                                                    "label": "Temperature",
                                                    "value": 8.4,
                                                    "unit": "°C",
                                                    "min": 2,
                                                    "max": 6
                                                }
                                            ],
                                            "warnings": []
                                        },
                                        "late": false,
                                        "late_reason": null,
                                        "comment": "Door was left open",
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/a1b2.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/a1b2.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "deviation_uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "source": "app",
                                        "revision": 0,
                                        "voided": false,
                                        "void_reason": null,
                                        "updated_at": "2026-11-03T09:02:05+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/equipment": {
            "get": {
                "operationId": "haccpEquipmentList",
                "summary": "List HACCP equipment",
                "description": "Controlled objects (fridges, freezers, thermometers, …) at the visible locations with limits, calibration dates and the last measurement.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_equipment_list",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "query",
                        "description": "Only this location",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Object type key, e.g. `fridge`",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "type_label": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "serial": {
                                                        "type": "string"
                                                    },
                                                    "limits": {
                                                        "type": "object",
                                                        "properties": {
                                                            "temperature": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "min": {
                                                                        "type": "integer"
                                                                    },
                                                                    "max": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "calibrated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "calibration_due_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "calibration_overdue": {
                                                        "type": "boolean"
                                                    },
                                                    "note": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    },
                                                    "last": {
                                                        "type": "object",
                                                        "properties": {
                                                            "values": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "temperature": {
                                                                        "type": "number"
                                                                    }
                                                                }
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "recorded_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 301,
                                            "location": {
                                                "id": 4609,
                                                "name": "Abay Ave"
                                            },
                                            "type": "fridge",
                                            "type_label": "Fridge",
                                            "name": "Fridge #1",
                                            "serial": "LG-2231",
                                            "limits": {
                                                "temperature": {
                                                    "min": 2,
                                                    "max": 6
                                                }
                                            },
                                            "calibrated_at": null,
                                            "calibration_due_at": null,
                                            "calibration_overdue": false,
                                            "note": null,
                                            "active": true,
                                            "last": {
                                                "values": {
                                                    "temperature": 4.1
                                                },
                                                "status": "ok",
                                                "recorded_at": "2026-11-03T11:00:00+05:00"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "haccpEquipmentCreate",
                "summary": "Add HACCP equipment",
                "description": "Adds a controlled object at a HACCP location. Without `limits` the country profile defaults for the type are used. Requires `haccp.registries`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_equipment_create",
                "x-permissions": [
                    "haccp.registries"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "location_id": {
                                        "type": "integer",
                                        "description": "HACCP location id"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "Object type key of the country profile (`fridge`, `freezer`, …); unknown — `other`",
                                        "maxLength": 60
                                    },
                                    "name": {
                                        "type": "string",
                                        "maxLength": 190
                                    },
                                    "serial": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "limits": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "`{\"temperature\": {\"min\": 2, \"max\": 6}, \"humidity\": {\"min\": 40, \"max\": 70}}`"
                                    },
                                    "calibrated_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "calibration_due_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "active": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "location_id",
                                    "name"
                                ]
                            },
                            "example": {
                                "location_id": 12,
                                "type": "string",
                                "name": "Replace the broken fridge seal",
                                "serial": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "type_label": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "serial": {
                                                    "type": "string"
                                                },
                                                "limits": {
                                                    "type": "object",
                                                    "properties": {
                                                        "temperature": {
                                                            "type": "object",
                                                            "properties": {
                                                                "min": {
                                                                    "type": "integer"
                                                                },
                                                                "max": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "calibrated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "calibration_due_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "calibration_overdue": {
                                                    "type": "boolean"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "last": {
                                                    "type": "object",
                                                    "properties": {
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 301,
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "type": "fridge",
                                        "type_label": "Fridge",
                                        "name": "Fridge #1",
                                        "serial": "LG-2231",
                                        "limits": {
                                            "temperature": {
                                                "min": 2,
                                                "max": 6
                                            }
                                        },
                                        "calibrated_at": null,
                                        "calibration_due_at": null,
                                        "calibration_overdue": false,
                                        "note": null,
                                        "active": true,
                                        "last": {
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "status": "ok",
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/equipment/{id}": {
            "patch": {
                "operationId": "haccpEquipmentUpdate",
                "summary": "Update HACCP equipment",
                "description": "Partial update of a controlled object. Requires `haccp.registries`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_equipment_update",
                "x-permissions": [
                    "haccp.registries"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Object id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "location_id": {
                                        "type": "integer",
                                        "description": "HACCP location id"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "Object type key of the country profile (`fridge`, `freezer`, …); unknown — `other`",
                                        "maxLength": 60
                                    },
                                    "name": {
                                        "type": "string",
                                        "maxLength": 190
                                    },
                                    "serial": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "limits": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "`{\"temperature\": {\"min\": 2, \"max\": 6}, \"humidity\": {\"min\": 40, \"max\": 70}}`"
                                    },
                                    "calibrated_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "calibration_due_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "active": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "location_id": 12,
                                "type": "string",
                                "name": "Replace the broken fridge seal",
                                "serial": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "type_label": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "serial": {
                                                    "type": "string"
                                                },
                                                "limits": {
                                                    "type": "object",
                                                    "properties": {
                                                        "temperature": {
                                                            "type": "object",
                                                            "properties": {
                                                                "min": {
                                                                    "type": "integer"
                                                                },
                                                                "max": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "calibrated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "calibration_due_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "calibration_overdue": {
                                                    "type": "boolean"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "last": {
                                                    "type": "object",
                                                    "properties": {
                                                        "values": {
                                                            "type": "object",
                                                            "properties": {
                                                                "temperature": {
                                                                    "type": "number"
                                                                }
                                                            }
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "recorded_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 301,
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "type": "fridge",
                                        "type_label": "Fridge",
                                        "name": "Fridge #1",
                                        "serial": "LG-2231",
                                        "limits": {
                                            "temperature": {
                                                "min": 2,
                                                "max": 6
                                            }
                                        },
                                        "calibrated_at": null,
                                        "calibration_due_at": null,
                                        "calibration_overdue": false,
                                        "note": null,
                                        "active": true,
                                        "last": {
                                            "values": {
                                                "temperature": 4.1
                                            },
                                            "status": "ok",
                                            "recorded_at": "2026-11-03T11:00:00+05:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "haccpEquipmentDelete",
                "summary": "Delete HACCP equipment",
                "description": "Removes a controlled object; its entries are kept. Requires `haccp.registries`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_equipment_delete",
                "x-permissions": [
                    "haccp.registries"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Object id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/journals": {
            "get": {
                "operationId": "haccpJournalsList",
                "summary": "List HACCP journals",
                "description": "Journals of the company with their field structure and schedule.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_journals_list",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "active",
                        "in": "query",
                        "description": "Only enabled (`true`) or disabled (`false`) journals",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "location_id",
                        "in": "query",
                        "description": "Only journals kept at this location",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "monitoring",
                                "prp",
                                "receiving",
                                "personnel",
                                "cleaning",
                                "other"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    },
                                                    "subject": {
                                                        "type": "string"
                                                    },
                                                    "event_based": {
                                                        "type": "boolean"
                                                    },
                                                    "schedule": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "times": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "schedule_text": {
                                                        "type": "string"
                                                    },
                                                    "fields": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "key": {
                                                                    "type": "string"
                                                                },
                                                                "label": {
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "unit": {
                                                                    "type": "string"
                                                                },
                                                                "required": {
                                                                    "type": "boolean"
                                                                },
                                                                "min": {
                                                                    "type": "integer"
                                                                },
                                                                "max": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "object_types": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "location_ids": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "position_ids": {
                                                        "type": "array"
                                                    },
                                                    "ccp_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "requires_photo_on_deviation": {
                                                        "type": "boolean"
                                                    },
                                                    "template_key": {
                                                        "type": "string"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 14,
                                            "uuid": "4c3b2a1f-0e9d-4c8b-9a7f-6e5d4c3b2a1f",
                                            "title": "Storage temperature",
                                            "description": "Fridges and freezers, twice per shift",
                                            "category": "monitoring",
                                            "icon": "kitchen",
                                            "color": "#0e9aa7",
                                            "active": true,
                                            "subject": "object",
                                            "event_based": false,
                                            "schedule": {
                                                "type": "times",
                                                "times": [
                                                    "09:00",
                                                    "17:00"
                                                ]
                                            },
                                            "schedule_text": "Daily at 09:00, 17:00",
                                            "fields": [
                                                {
                                                    "key": "temperature",
                                                    "label": "Temperature",
                                                    "type": "temperature",
                                                    "unit": "°C",
                                                    "required": true,
                                                    "min": 2,
                                                    "max": 6
                                                }
                                            ],
                                            "object_types": [
                                                "fridge",
                                                "freezer"
                                            ],
                                            "location_ids": null,
                                            "position_ids": [],
                                            "ccp_id": null,
                                            "requires_photo_on_deviation": false,
                                            "template_key": "storage_temperature",
                                            "updated_at": "2026-10-20T10:00:00+05:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/journals/{id}": {
            "get": {
                "operationId": "haccpJournalsGet",
                "summary": "Retrieve a HACCP journal",
                "description": "Journal structure: fields (types, units, limits), schedule, subject (`site`, `object`, `employee`), object types, locations and positions, plus objects at the visible locations.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_journals_get",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Journal id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "subject": {
                                                    "type": "string"
                                                },
                                                "event_based": {
                                                    "type": "boolean"
                                                },
                                                "schedule": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "times": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "schedule_text": {
                                                    "type": "string"
                                                },
                                                "fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "min": {
                                                                "type": "integer"
                                                            },
                                                            "max": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "object_types": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "location_ids": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "position_ids": {
                                                    "type": "array"
                                                },
                                                "ccp_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "requires_photo_on_deviation": {
                                                    "type": "boolean"
                                                },
                                                "template_key": {
                                                    "type": "string"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "objects": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "limits": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "temperature": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "min": {
                                                                                "type": "integer"
                                                                            },
                                                                            "max": {
                                                                                "type": "integer"
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 14,
                                        "uuid": "4c3b2a1f-0e9d-4c8b-9a7f-6e5d4c3b2a1f",
                                        "title": "Storage temperature",
                                        "description": "Fridges and freezers, twice per shift",
                                        "category": "monitoring",
                                        "icon": "kitchen",
                                        "color": "#0e9aa7",
                                        "active": true,
                                        "subject": "object",
                                        "event_based": false,
                                        "schedule": {
                                            "type": "times",
                                            "times": [
                                                "09:00",
                                                "17:00"
                                            ]
                                        },
                                        "schedule_text": "Daily at 09:00, 17:00",
                                        "fields": [
                                            {
                                                "key": "temperature",
                                                "label": "Temperature",
                                                "type": "temperature",
                                                "unit": "°C",
                                                "required": true,
                                                "min": 2,
                                                "max": 6
                                            }
                                        ],
                                        "object_types": [
                                            "fridge",
                                            "freezer"
                                        ],
                                        "location_ids": null,
                                        "position_ids": [],
                                        "ccp_id": null,
                                        "requires_photo_on_deviation": false,
                                        "template_key": "storage_temperature",
                                        "updated_at": "2026-10-20T10:00:00+05:00",
                                        "objects": [
                                            {
                                                "id": 301,
                                                "name": "Fridge #1",
                                                "type": "fridge",
                                                "location": {
                                                    "id": 4609,
                                                    "name": "Abay Ave"
                                                },
                                                "limits": {
                                                    "temperature": {
                                                        "min": 2,
                                                        "max": 6
                                                    }
                                                },
                                                "active": true
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/journals/{id}/entries": {
            "post": {
                "operationId": "haccpEntriesCreate",
                "summary": "Record a HACCP journal entry",
                "description": "Records a measurement/check. Values are checked against the field and object limits: out of limits — the entry gets status `deviation` and a deviation is opened (notifications as in the app). Idempotent with `uuid`: repeating the same `uuid` returns the existing entry. With `deviation_id` — a re-check after correction.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_entries_create",
                "x-permissions": [
                    "haccp.fill"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Journal id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "location_id": {
                                        "type": "integer",
                                        "description": "Location id"
                                    },
                                    "values": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Field values by field `key`, e.g. `{\"temperature\": 4.2}`"
                                    },
                                    "object_id": {
                                        "type": "integer",
                                        "description": "Object (journals with subject `object`)"
                                    },
                                    "subject_user_id": {
                                        "type": "integer",
                                        "description": "Employee the entry is about (journals with subject `employee`, e.g. health check)"
                                    },
                                    "recorded_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "description": "Measurement time (device time for offline sync), default — now"
                                    },
                                    "uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Client-generated UUID for safe retries"
                                    },
                                    "comment": {
                                        "type": "string",
                                        "maxLength": 2000
                                    },
                                    "photos": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Paths from `haccp.media.upload`",
                                        "maxItems": 10
                                    },
                                    "deviation_id": {
                                        "type": "integer",
                                        "description": "Re-check measurement for this deviation"
                                    },
                                    "late_reason": {
                                        "type": "string",
                                        "description": "Why the entry is recorded later than the measurement",
                                        "maxLength": 255
                                    },
                                    "latitude": {
                                        "type": "number"
                                    },
                                    "longitude": {
                                        "type": "number"
                                    }
                                },
                                "required": [
                                    "location_id",
                                    "values"
                                ]
                            },
                            "example": {
                                "location_id": 12,
                                "values": [],
                                "object_id": 42,
                                "subject_user_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "journal_id": {
                                                    "type": "integer"
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "object_id": {
                                                    "type": "integer"
                                                },
                                                "subject_user": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recorded_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "values": {
                                                    "type": "object",
                                                    "properties": {
                                                        "temperature": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "flags": {
                                                    "type": "object",
                                                    "properties": {
                                                        "breaches": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "value": {
                                                                        "type": "number"
                                                                    },
                                                                    "unit": {
                                                                        "type": "string"
                                                                    },
                                                                    "min": {
                                                                        "type": "integer"
                                                                    },
                                                                    "max": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "warnings": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "late": {
                                                    "type": "boolean"
                                                },
                                                "late_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "comment": {
                                                    "type": "string"
                                                },
                                                "photos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "path": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "deviation_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "revision": {
                                                    "type": "integer"
                                                },
                                                "voided": {
                                                    "type": "boolean"
                                                },
                                                "void_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 88231,
                                        "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                        "journal_id": 14,
                                        "location": {
                                            "id": 4609,
                                            "name": "Abay Ave"
                                        },
                                        "object_id": 301,
                                        "subject_user": null,
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "recorded_at": "2026-11-03T09:02:00+05:00",
                                        "values": {
                                            "temperature": 8.4
                                        },
                                        "status": "deviation",
                                        "flags": {
                                            "breaches": [
                                                {
                                                    "key": "temperature",
                                                    "label": "Temperature",
                                                    "value": 8.4,
                                                    "unit": "°C",
                                                    "min": 2,
                                                    "max": 6
                                                }
                                            ],
                                            "warnings": []
                                        },
                                        "late": false,
                                        "late_reason": null,
                                        "comment": "Door was left open",
                                        "photos": [
                                            {
                                                "path": "haccp/761/photos/2026/11/a1b2.jpg",
                                                "url": "https://storage.example.com/haccp/761/photos/2026/11/a1b2.jpg?X-Amz-Signature=…"
                                            }
                                        ],
                                        "deviation_uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                        "source": "app",
                                        "revision": 0,
                                        "voided": false,
                                        "void_reason": null,
                                        "updated_at": "2026-11-03T09:02:05+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/media": {
            "post": {
                "operationId": "haccpMediaUpload",
                "summary": "Upload a HACCP photo or document",
                "description": "Uploads an image (jpg, png, webp, heic) or PDF and returns its `path` for `photos` of an entry or deviation, photo fields, staff documents and verification records.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_media_upload",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "File (multipart; in MCP — object with `name` and `content_base64`)"
                                    },
                                    "folder": {
                                        "type": "string",
                                        "enum": [
                                            "photos",
                                            "docs"
                                        ],
                                        "default": "photos"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "File (multipart; in MCP — object with `name` and `content_base64`)"
                                    },
                                    "folder": {
                                        "type": "string",
                                        "enum": [
                                            "photos",
                                            "docs"
                                        ],
                                        "default": "photos"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "path": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "path": "haccp/761/photos/2026/11/a1b2.jpg",
                                        "url": "https://storage.example.com/haccp/761/photos/2026/11/a1b2.jpg?X-Amz-Signature=…"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/medical-books": {
            "get": {
                "operationId": "haccpMedicalList",
                "summary": "List staff medical books",
                "description": "Employees of locations where the token has the sensitive `haccp.medical` permission, with the latest document of each type (medical book, hygiene training, …) and its status (`valid`, `expiring`, `expired`, `missing`). Each call is written to the access log.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_medical_list",
                "x-permissions": [
                    "haccp.medical"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "position": {
                                                        "type": "string"
                                                    },
                                                    "location_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "problems": {
                                                        "type": "integer"
                                                    },
                                                    "docs": {
                                                        "type": "object",
                                                        "properties": {
                                                            "medical_book": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "doc_id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "number": {
                                                                        "type": "string"
                                                                    },
                                                                    "issued_at": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "expires_at": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "history": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "number": {
                                                                    "type": "string"
                                                                },
                                                                "issued_at": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "expires_at": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "issuer": {
                                                                    "type": "string"
                                                                },
                                                                "note": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "file": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "path": {
                                                                            "type": "string"
                                                                        },
                                                                        "url": {
                                                                            "type": "string",
                                                                            "format": "uri"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 311,
                                            "name": "Aigerim Sadykova",
                                            "position": "Cook",
                                            "location_ids": [
                                                4609
                                            ],
                                            "problems": 0,
                                            "docs": {
                                                "medical_book": {
                                                    "doc_id": 77,
                                                    "number": "MB-1022",
                                                    "issued_at": "2026-03-01",
                                                    "expires_at": "2027-03-01",
                                                    "status": "valid"
                                                }
                                            },
                                            "history": [
                                                {
                                                    "id": 77,
                                                    "type": "medical_book",
                                                    "number": "MB-1022",
                                                    "issued_at": "2026-03-01",
                                                    "expires_at": "2027-03-01",
                                                    "issuer": "City clinic #4",
                                                    "note": null,
                                                    "file": {
                                                        "path": "haccp/761/docs/2026/03/mb.pdf",
                                                        "url": "https://storage.example.com/haccp/761/docs/2026/03/mb.pdf?X-Amz-Signature=…"
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "haccpMedicalCreate",
                "summary": "Add a staff medical document",
                "description": "Records a medical book / health document of an employee. Requires `haccp.registries` and `haccp.medical` for the employee's location. `expires_at` defaults from the document type validity.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_medical_create",
                "x-permissions": [
                    "haccp.registries"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "Document type key of the country profile, e.g. `medical_book`",
                                        "maxLength": 60
                                    },
                                    "number": {
                                        "type": "string",
                                        "maxLength": 120
                                    },
                                    "issued_at": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "expires_at": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "issuer": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "note": {
                                        "type": "string",
                                        "maxLength": 500
                                    },
                                    "file": {
                                        "type": "string",
                                        "description": "Scan path from `haccp.media.upload` (folder `docs`)"
                                    }
                                },
                                "required": [
                                    "user_id",
                                    "type"
                                ]
                            },
                            "example": {
                                "user_id": 42,
                                "type": "string",
                                "number": "string",
                                "issued_at": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "issued_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "expires_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "issuer": {
                                                    "type": "string"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 77,
                                        "user_id": 311,
                                        "type": "medical_book",
                                        "number": "MB-1022",
                                        "issued_at": "2026-03-01",
                                        "expires_at": "2027-03-01",
                                        "issuer": "City clinic #4",
                                        "note": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/plans": {
            "get": {
                "operationId": "haccpPlansList",
                "summary": "List HACCP plans",
                "description": "HACCP plans with status, version, review date and completion of the 12 Codex steps.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_plans_list",
                "x-permissions": [
                    "haccp.plan"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "version": {
                                                        "type": "integer"
                                                    },
                                                    "review_due_at": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "location_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "progress": {
                                                        "type": "object",
                                                        "properties": {
                                                            "1": {
                                                                "type": "boolean"
                                                            },
                                                            "2": {
                                                                "type": "boolean"
                                                            },
                                                            "3": {
                                                                "type": "boolean"
                                                            },
                                                            "4": {
                                                                "type": "boolean"
                                                            },
                                                            "5": {
                                                                "type": "boolean"
                                                            },
                                                            "6": {
                                                                "type": "boolean"
                                                            },
                                                            "7": {
                                                                "type": "boolean"
                                                            },
                                                            "8": {
                                                                "type": "boolean"
                                                            },
                                                            "9": {
                                                                "type": "boolean"
                                                            },
                                                            "10": {
                                                                "type": "boolean"
                                                            },
                                                            "11": {
                                                                "type": "boolean"
                                                            },
                                                            "12": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    },
                                                    "problems": {
                                                        "type": "integer"
                                                    },
                                                    "has_changes": {
                                                        "type": "boolean"
                                                    },
                                                    "counts": {
                                                        "type": "object",
                                                        "properties": {
                                                            "steps": {
                                                                "type": "integer"
                                                            },
                                                            "hazards": {
                                                                "type": "integer"
                                                            },
                                                            "ccps": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 3,
                                            "uuid": "8b7a6c5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
                                            "title": "Hot kitchen",
                                            "status": "approved",
                                            "version": 2,
                                            "review_due_at": "2027-05-01",
                                            "location_ids": [
                                                4609
                                            ],
                                            "progress": {
                                                "1": true,
                                                "2": true,
                                                "3": true,
                                                "4": true,
                                                "5": true,
                                                "6": true,
                                                "7": true,
                                                "8": true,
                                                "9": true,
                                                "10": true,
                                                "11": false,
                                                "12": true
                                            },
                                            "problems": 1,
                                            "has_changes": false,
                                            "counts": {
                                                "steps": 9,
                                                "hazards": 14,
                                                "ccps": 2
                                            },
                                            "updated_at": "2026-10-28T15:00:00+05:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/plans/{id}": {
            "get": {
                "operationId": "haccpPlansGet",
                "summary": "Retrieve a HACCP plan",
                "description": "Full plan by the 12 Codex steps: team, products, process flow steps, hazard analysis, critical control points with limits, monitoring and corrective actions; open problems per step.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_plans_get",
                "x-permissions": [
                    "haccp.plan"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Plan id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "scope": {
                                                    "type": "string"
                                                },
                                                "location_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "intended_use": {
                                                    "type": "string"
                                                },
                                                "consumer_groups": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "prerequisites": {
                                                    "type": "array"
                                                },
                                                "flow_confirmed_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "flow_confirmed_by": {
                                                    "type": "integer"
                                                },
                                                "documentation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "records": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "validation": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "risk_threshold": {
                                                    "type": "integer"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "team": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "user_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            },
                                                            "job_title": {
                                                                "type": "string"
                                                            },
                                                            "competence": {
                                                                "type": "string"
                                                            },
                                                            "responsibilities": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "products": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "group": {
                                                                "type": "string"
                                                            },
                                                            "composition": {
                                                                "type": "string"
                                                            },
                                                            "characteristics": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "processing": {
                                                                "type": "string"
                                                            },
                                                            "packaging": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "storage": {
                                                                "type": "string"
                                                            },
                                                            "shelf_life": {
                                                                "type": "string"
                                                            },
                                                            "distribution": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "allergens": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "labeling": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "intended_use": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "steps": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "parameters": {
                                                                "type": "string"
                                                            },
                                                            "inputs": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "outsourced": {
                                                                "type": "boolean"
                                                            },
                                                            "rework": {
                                                                "type": "boolean"
                                                            },
                                                            "analyzed": {
                                                                "type": "boolean"
                                                            },
                                                            "next": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "products": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "position": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "hazards": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "step_id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "likelihood": {
                                                                "type": "integer"
                                                            },
                                                            "severity": {
                                                                "type": "integer"
                                                            },
                                                            "significant": {
                                                                "type": "boolean"
                                                            },
                                                            "justification": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "control_measures": {
                                                                "type": "string"
                                                            },
                                                            "decision": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "q1": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            },
                                                            "outcome": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ccps": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "step_id": {
                                                                "type": "integer"
                                                            },
                                                            "hazard_id": {
                                                                "type": "integer"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "limits": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "field": {
                                                                            "type": "string"
                                                                        },
                                                                        "min": {
                                                                            "type": "integer"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "limits_justification": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "monitoring_what": {
                                                                "type": "string"
                                                            },
                                                            "monitoring_how": {
                                                                "type": "string"
                                                            },
                                                            "monitoring_frequency": {
                                                                "type": "string"
                                                            },
                                                            "monitoring_positions": {
                                                                "type": "array"
                                                            },
                                                            "journal_id": {
                                                                "type": "integer"
                                                            },
                                                            "corrective_actions": {
                                                                "type": "string"
                                                            },
                                                            "corrective_positions": {
                                                                "type": "array"
                                                            },
                                                            "verification": {
                                                                "type": "string"
                                                            },
                                                            "verification_frequency": {
                                                                "type": "string"
                                                            },
                                                            "validation": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "records": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "step": {
                                                                "type": "integer"
                                                            },
                                                            "message": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 3,
                                        "uuid": "8b7a6c5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
                                        "title": "Hot kitchen",
                                        "scope": "Hot dishes of the main menu",
                                        "location_ids": [
                                            4609
                                        ],
                                        "status": "approved",
                                        "intended_use": "Served hot within 2 hours",
                                        "consumer_groups": [
                                            "general"
                                        ],
                                        "prerequisites": [],
                                        "flow_confirmed_at": "2026-10-10",
                                        "flow_confirmed_by": 120,
                                        "documentation": {
                                            "records": []
                                        },
                                        "validation": null,
                                        "risk_threshold": 6,
                                        "version": 2,
                                        "review_due_at": "2027-05-01",
                                        "updated_at": "2026-10-28T15:00:00+05:00",
                                        "team": [
                                            {
                                                "id": 1,
                                                "user_id": 120,
                                                "name": "Daniyar Omarov",
                                                "role": "leader",
                                                "job_title": "Chef",
                                                "competence": "HACCP course 2025",
                                                "responsibilities": "Plan owner"
                                            }
                                        ],
                                        "products": [
                                            {
                                                "id": 4,
                                                "name": "Chicken soup",
                                                "group": "hot",
                                                "composition": "Chicken, vegetables",
                                                "characteristics": null,
                                                "processing": "Boiling",
                                                "packaging": null,
                                                "storage": "+2…+6 °C",
                                                "shelf_life": "24 h",
                                                "distribution": null,
                                                "allergens": [
                                                    "celery"
                                                ],
                                                "labeling": null,
                                                "intended_use": null
                                            }
                                        ],
                                        "steps": [
                                            {
                                                "id": 21,
                                                "name": "Cooking",
                                                "type": "process",
                                                "description": null,
                                                "parameters": "≥ 75 °C in the core",
                                                "inputs": null,
                                                "outsourced": false,
                                                "rework": false,
                                                "analyzed": true,
                                                "next": [
                                                    22
                                                ],
                                                "products": [
                                                    4
                                                ],
                                                "position": 3
                                            }
                                        ],
                                        "hazards": [
                                            {
                                                "id": 51,
                                                "step_id": 21,
                                                "type": "biological",
                                                "name": "Salmonella survival",
                                                "source": "Raw chicken",
                                                "likelihood": 3,
                                                "severity": 3,
                                                "significant": true,
                                                "justification": null,
                                                "control_measures": "Core temperature control",
                                                "decision": {
                                                    "q1": true
                                                },
                                                "outcome": "ccp"
                                            }
                                        ],
                                        "ccps": [
                                            {
                                                "id": 7,
                                                "step_id": 21,
                                                "hazard_id": 51,
                                                "kind": "ccp",
                                                "code": "CCP-1",
                                                "name": "Core temperature",
                                                "limits": [
                                                    {
                                                        "field": "temperature",
                                                        "min": 75
                                                    }
                                                ],
                                                "limits_justification": null,
                                                "monitoring_what": "Core temperature",
                                                "monitoring_how": "Probe thermometer",
                                                "monitoring_frequency": "Each batch",
                                                "monitoring_positions": [],
                                                "journal_id": 15,
                                                "corrective_actions": "Continue cooking",
                                                "corrective_positions": [],
                                                "verification": "Weekly journal review",
                                                "verification_frequency": "weekly",
                                                "validation": null,
                                                "records": null
                                            }
                                        ],
                                        "problems": [
                                            {
                                                "step": 11,
                                                "message": "Describe verification procedures"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/settings": {
            "get": {
                "operationId": "haccpSettingsGet",
                "summary": "Get HACCP settings",
                "description": "Module settings: country profile of norms, timezone, shift start, HACCP leader, retention and grace periods, options and HACCP locations. Requires `haccp.settings`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_settings_get",
                "x-permissions": [
                    "haccp.settings"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "profile": {
                                                    "type": "string"
                                                },
                                                "profile_name": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "shift_start": {
                                                    "type": "string"
                                                },
                                                "leader": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "retention_months": {
                                                    "type": "integer"
                                                },
                                                "grace_minutes": {
                                                    "type": "integer"
                                                },
                                                "options": {
                                                    "type": "object",
                                                    "properties": {
                                                        "late_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "expiry_warning_days": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "onboarded_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "sites": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "seats": {
                                                                "type": "integer"
                                                            },
                                                            "shift_start": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "work_days": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "profile": "kz",
                                        "profile_name": "Kazakhstan",
                                        "timezone": "Asia/Almaty",
                                        "shift_start": "08:00",
                                        "leader": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "retention_months": 12,
                                        "grace_minutes": 30,
                                        "options": {
                                            "late_minutes": 60,
                                            "expiry_warning_days": 30
                                        },
                                        "onboarded_at": "2026-10-17T12:00:00+05:00",
                                        "sites": [
                                            {
                                                "location": {
                                                    "id": 4609,
                                                    "name": "Abay Ave"
                                                },
                                                "kind": "cafe",
                                                "seats": 40,
                                                "shift_start": null,
                                                "work_days": [
                                                    1,
                                                    2,
                                                    3,
                                                    4,
                                                    5,
                                                    6,
                                                    7
                                                ],
                                                "active": true
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/sites": {
            "get": {
                "operationId": "haccpSites",
                "summary": "List HACCP locations",
                "description": "HACCP status of the company (enabled, country profile, timezone) and the HACCP locations visible to the token.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_sites",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "profile": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "sites": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "enabled": true,
                                        "profile": "kz",
                                        "timezone": "Asia/Almaty",
                                        "sites": [
                                            {
                                                "id": 4609,
                                                "name": "Abay Ave",
                                                "address": "10 Abay Ave",
                                                "kind": "cafe"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/slots/{id}/skip": {
            "post": {
                "operationId": "haccpSlotsSkip",
                "summary": "Skip a scheduled HACCP check",
                "description": "Marks a time slot as not required today (location closed, equipment off) with a reason. Requires `haccp.resolve` at the location.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_slots_skip",
                "x-permissions": [
                    "haccp.resolve"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Slot id from `haccp.today`",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "reason"
                                ]
                            },
                            "example": {
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "skipped": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "skipped": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/suppliers": {
            "get": {
                "operationId": "haccpSuppliersList",
                "summary": "List HACCP suppliers",
                "description": "Approved suppliers with their documents (certificates, declarations) and expiry status.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_suppliers_list",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "tax_id": {
                                                        "type": "string"
                                                    },
                                                    "contact": {
                                                        "type": "string"
                                                    },
                                                    "phone": {
                                                        "type": "string"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "products": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "rating": {
                                                        "type": "integer"
                                                    },
                                                    "note": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "evaluated_at": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "expired": {
                                                        "type": "integer"
                                                    },
                                                    "expiring": {
                                                        "type": "integer"
                                                    },
                                                    "docs": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "number": {
                                                                    "type": "string"
                                                                },
                                                                "product": {
                                                                    "type": "string"
                                                                },
                                                                "issued_at": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "valid_until": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "status": {
                                                                    "type": "string"
                                                                },
                                                                "file": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 12,
                                            "name": "Fresh Farm LLP",
                                            "tax_id": "123456789012",
                                            "contact": "Arman",
                                            "phone": "+7 701 000 00 00",
                                            "email": "sales@freshfarm.kz",
                                            "products": "Poultry",
                                            "status": "approved",
                                            "rating": 5,
                                            "note": null,
                                            "evaluated_at": "2026-09-01",
                                            "expired": 0,
                                            "expiring": 1,
                                            "docs": [
                                                {
                                                    "id": 30,
                                                    "type": "certificate",
                                                    "number": "KZ-77",
                                                    "product": "Chicken",
                                                    "issued_at": "2026-01-10",
                                                    "valid_until": "2026-11-20",
                                                    "status": "expiring",
                                                    "file": null
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/today": {
            "get": {
                "operationId": "haccpToday",
                "summary": "Get today's HACCP checks",
                "description": "What must be recorded today: journals with time slots (status `pending`, `overdue`, `done`, `late`, `missed`, `skipped`), objects with limits, today's entries, staff on shift and open deviations. Without `location_id` — all HACCP locations visible to the token.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_today",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "location_id",
                        "in": "query",
                        "description": "One location; omitted — all visible locations",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "day": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "late_minutes": {
                                                    "type": "integer"
                                                },
                                                "sites": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "can_resolve": {
                                                                "type": "boolean"
                                                            },
                                                            "summary": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "pending": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    },
                                                                    "deviations": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "journals": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "category": {
                                                                            "type": "string"
                                                                        },
                                                                        "subject": {
                                                                            "type": "string"
                                                                        },
                                                                        "event_based": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "schedule_text": {
                                                                            "type": "string"
                                                                        },
                                                                        "fields": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "label": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "unit": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "required": {
                                                                                        "type": "boolean"
                                                                                    },
                                                                                    "min": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "max": {
                                                                                        "type": "integer"
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "can_fill": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "objects": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "id": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "name": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type_label": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "limits": {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                            "temperature": {
                                                                                                "type": "object",
                                                                                                "properties": {
                                                                                                    "min": {
                                                                                                        "type": "integer"
                                                                                                    },
                                                                                                    "max": {
                                                                                                        "type": "integer"
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "slots": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "id": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "object_id": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "opens_at": {
                                                                                        "type": "string",
                                                                                        "format": "date-time"
                                                                                    },
                                                                                    "due_at": {
                                                                                        "type": "string",
                                                                                        "format": "date-time"
                                                                                    },
                                                                                    "status": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "open": {
                                                                                        "type": "boolean"
                                                                                    },
                                                                                    "entry_id": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "skip_reason": {
                                                                                        "type": [
                                                                                            "string",
                                                                                            "null"
                                                                                        ]
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "entries": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "object",
                                                                                "properties": {
                                                                                    "id": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "uuid": {
                                                                                        "type": "string",
                                                                                        "format": "uuid"
                                                                                    },
                                                                                    "object_id": {
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "subject_user": {
                                                                                        "type": [
                                                                                            "string",
                                                                                            "null"
                                                                                        ]
                                                                                    },
                                                                                    "recorded_at": {
                                                                                        "type": "string",
                                                                                        "format": "date-time"
                                                                                    },
                                                                                    "values": {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                            "temperature": {
                                                                                                "type": "number"
                                                                                            }
                                                                                        }
                                                                                    },
                                                                                    "status": {
                                                                                        "type": "string"
                                                                                    },
                                                                                    "late": {
                                                                                        "type": "boolean"
                                                                                    }
                                                                                }
                                                                            }
                                                                        },
                                                                        "done": {
                                                                            "type": "integer"
                                                                        },
                                                                        "pending": {
                                                                            "type": "integer"
                                                                        },
                                                                        "total": {
                                                                            "type": "integer"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "staff": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "on_shift": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "deviations": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "journal": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "title": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "object_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "severity": {
                                                                            "type": "string"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "due_at": {
                                                                            "type": "string",
                                                                            "format": "date-time"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "recheck": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "day": "2026-11-03",
                                        "timezone": "Asia/Almaty",
                                        "late_minutes": 60,
                                        "sites": [
                                            {
                                                "location": {
                                                    "id": 4609,
                                                    "name": "Abay Ave"
                                                },
                                                "can_resolve": false,
                                                "summary": {
                                                    "total": 9,
                                                    "done": 4,
                                                    "pending": 5,
                                                    "overdue": 1,
                                                    "deviations": 1
                                                },
                                                "journals": [
                                                    {
                                                        "id": 14,
                                                        "uuid": "4c3b2a1f-0e9d-4c8b-9a7f-6e5d4c3b2a1f",
                                                        "title": "Storage temperature",
                                                        "category": "monitoring",
                                                        "subject": "object",
                                                        "event_based": false,
                                                        "schedule_text": "Daily at 09:00, 17:00",
                                                        "fields": [
                                                            {
                                                                "key": "temperature",
                                                                "label": "Temperature",
                                                                "type": "temperature",
                                                                "unit": "°C",
                                                                "required": true,
                                                                "min": 2,
                                                                "max": 6
                                                            }
                                                        ],
                                                        "can_fill": true,
                                                        "objects": [
                                                            {
                                                                "id": 301,
                                                                "name": "Fridge #1",
                                                                "type": "fridge",
                                                                "type_label": "Fridge",
                                                                "limits": {
                                                                    "temperature": {
                                                                        "min": 2,
                                                                        "max": 6
                                                                    }
                                                                }
                                                            }
                                                        ],
                                                        "slots": [
                                                            {
                                                                "id": 99120,
                                                                "object_id": 301,
                                                                "opens_at": "2026-11-03T08:00:00+05:00",
                                                                "due_at": "2026-11-03T09:00:00+05:00",
                                                                "status": "done",
                                                                "open": true,
                                                                "entry_id": 88231,
                                                                "skip_reason": null
                                                            }
                                                        ],
                                                        "entries": [
                                                            {
                                                                "id": 88231,
                                                                "uuid": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a",
                                                                "object_id": 301,
                                                                "subject_user": null,
                                                                "recorded_at": "2026-11-03T09:02:00+05:00",
                                                                "values": {
                                                                    "temperature": 8.4
                                                                },
                                                                "status": "deviation",
                                                                "late": false
                                                            }
                                                        ],
                                                        "done": 1,
                                                        "pending": 1,
                                                        "total": 2
                                                    }
                                                ],
                                                "staff": [
                                                    {
                                                        "id": 311,
                                                        "name": "Aigerim Sadykova",
                                                        "on_shift": true
                                                    }
                                                ],
                                                "deviations": [
                                                    {
                                                        "uuid": "0a9b8c7d-6e5f-4a3b-8c2d-1e0f9a8b7c6d",
                                                        "journal": {
                                                            "id": 14,
                                                            "title": "Storage temperature"
                                                        },
                                                        "object_id": 301,
                                                        "severity": "major",
                                                        "status": "open",
                                                        "due_at": "2026-11-04T09:02:00+05:00",
                                                        "overdue": false,
                                                        "recheck": false
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/verifications": {
            "get": {
                "operationId": "haccpVerificationsList",
                "summary": "List HACCP verification activities",
                "description": "Scheduled verification activities (internal audits, lab tests, swabs, calibration) with next due date and the latest records.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_verifications_list",
                "x-permissions": [
                    "haccp.view"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "every_days": {
                                                        "type": "integer"
                                                    },
                                                    "next_due_at": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "last_done_at": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "responsible": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "plan_id": {
                                                        "type": "integer"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    },
                                                    "overdue": {
                                                        "type": "boolean"
                                                    },
                                                    "records": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "done_at": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "user": {
                                                                    "type": "string"
                                                                },
                                                                "result": {
                                                                    "type": "string"
                                                                },
                                                                "findings": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "actions": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "files": {
                                                                    "type": "array"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 5,
                                            "type": "internal_audit",
                                            "title": "Quarterly HACCP audit",
                                            "description": null,
                                            "every_days": 90,
                                            "next_due_at": "2026-12-01",
                                            "last_done_at": "2026-09-01",
                                            "responsible": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "plan_id": 3,
                                            "active": true,
                                            "overdue": false,
                                            "records": [
                                                {
                                                    "id": 41,
                                                    "done_at": "2026-09-01",
                                                    "user": "Daniyar Omarov",
                                                    "result": "ok",
                                                    "findings": null,
                                                    "actions": null,
                                                    "files": []
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/haccp/verifications/{id}/records": {
            "post": {
                "operationId": "haccpVerificationsRecord",
                "summary": "Record a verification result",
                "description": "Records that a verification activity was done; the next due date moves by its interval. Findings are required when `result` is `issues`. Requires `haccp.registries`.",
                "tags": [
                    "HACCP"
                ],
                "x-mcp-tool": "haccp_verifications_record",
                "x-permissions": [
                    "haccp.registries"
                ],
                "x-plan-feature": "haccp",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Verification activity id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "done_at": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Default — today"
                                    },
                                    "result": {
                                        "type": "string",
                                        "enum": [
                                            "ok",
                                            "issues"
                                        ],
                                        "default": "ok"
                                    },
                                    "findings": {
                                        "type": "string",
                                        "maxLength": 5000
                                    },
                                    "actions": {
                                        "type": "string",
                                        "maxLength": 5000
                                    },
                                    "files": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Paths from `haccp.media.upload`",
                                        "maxItems": 10
                                    }
                                }
                            },
                            "example": {
                                "done_at": "2026-11-01",
                                "result": "ok",
                                "findings": "string",
                                "actions": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "verification_id": {
                                                    "type": "integer"
                                                },
                                                "done_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "result": {
                                                    "type": "string"
                                                },
                                                "findings": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "actions": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 42,
                                        "verification_id": 5,
                                        "done_at": "2026-11-03",
                                        "result": "ok",
                                        "findings": null,
                                        "actions": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/help/articles/{section}/{slug}": {
            "get": {
                "operationId": "helpArticle",
                "summary": "Read a help article",
                "description": "Full article in Markdown. `section` and `slug` come from `help.sections` or `help.search` results.",
                "tags": [
                    "Help center"
                ],
                "x-mcp-tool": "help_article",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "section",
                        "in": "path",
                        "required": true,
                        "description": "Section key, e.g. `tasks`",
                        "schema": {
                            "type": "string",
                            "maxLength": 64
                        }
                    },
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Article slug, e.g. `statuses`",
                        "schema": {
                            "type": "string",
                            "maxLength": 128
                        }
                    },
                    {
                        "name": "locale",
                        "in": "query",
                        "description": "Language of the articles; falls back to English when the language has no articles",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "en",
                                "ru",
                                "kk",
                                "uz",
                                "ka",
                                "hy",
                                "sr",
                                "de"
                            ],
                            "default": "en"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "section": {
                                                    "type": "string"
                                                },
                                                "slug": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "updated": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "reading_time_minutes": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "markdown": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "section": "tasks",
                                        "slug": "statuses",
                                        "title": "Task statuses",
                                        "description": "What each task status means and who can move a task.",
                                        "updated": "2026-10-17",
                                        "reading_time_minutes": 3,
                                        "url": "https://jecheck.io/en/docs/tasks/statuses",
                                        "markdown": "Every task moves through statuses…\n\n## New\n\nThe task is created…"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/help/search": {
            "get": {
                "operationId": "helpSearch",
                "summary": "Search the help center",
                "description": "Hybrid keyword and semantic search over help articles. Returns the best matching fragments (at most two per article) with a link to the exact section of the article.",
                "tags": [
                    "Help center"
                ],
                "x-mcp-tool": "help_search",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": true,
                        "description": "Question or keywords, e.g. \"how to require a photo after fixing a violation\"",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 500
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of fragments",
                        "schema": {
                            "type": "integer",
                            "default": 5,
                            "minimum": 1,
                            "maximum": 20
                        }
                    },
                    {
                        "name": "locale",
                        "in": "query",
                        "description": "Language of the articles; falls back to English when the language has no articles",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "en",
                                "ru",
                                "kk",
                                "uz",
                                "ka",
                                "hy",
                                "sr",
                                "de"
                            ],
                            "default": "en"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "article": {
                                                        "type": "string"
                                                    },
                                                    "section": {
                                                        "type": "string"
                                                    },
                                                    "slug": {
                                                        "type": "string"
                                                    },
                                                    "heading": {
                                                        "type": "string"
                                                    },
                                                    "excerpt": {
                                                        "type": "string"
                                                    },
                                                    "content": {
                                                        "type": "string"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "score": {
                                                        "type": "number"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "article": "Corrective-action loop",
                                            "section": "automation",
                                            "slug": "closed-loop",
                                            "heading": "Photo after the fix",
                                            "excerpt": "…turn on \"Photo after\" so the assignee must attach a photo before sending the task for review…",
                                            "content": "## Photo after the fix\n\nTurn on 'Photo after'…",
                                            "url": "https://jecheck.io/en/docs/automation/closed-loop#photo-after-the-fix",
                                            "score": 0.03226
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/help/sections": {
            "get": {
                "operationId": "helpSections",
                "summary": "List help sections and articles",
                "description": "The table of contents of the help center: sections in display order with their articles.",
                "tags": [
                    "Help center"
                ],
                "x-mcp-tool": "help_sections",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "locale",
                        "in": "query",
                        "description": "Language of the articles; falls back to English when the language has no articles",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "en",
                                "ru",
                                "kk",
                                "uz",
                                "ka",
                                "hy",
                                "sr",
                                "de"
                            ],
                            "default": "en"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "app_url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "articles": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "section": {
                                                                    "type": "string"
                                                                },
                                                                "slug": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                },
                                                                "description": {
                                                                    "type": "string"
                                                                },
                                                                "updated": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "reading_time_minutes": {
                                                                    "type": "integer"
                                                                },
                                                                "url": {
                                                                    "type": "string",
                                                                    "format": "uri"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "key": "tasks",
                                            "title": "Tasks",
                                            "app_url": "https://app.jecheck.io/ui/tasks",
                                            "articles": [
                                                {
                                                    "section": "tasks",
                                                    "slug": "statuses",
                                                    "title": "Task statuses",
                                                    "description": "What each task status means and who can move a task.",
                                                    "updated": "2026-10-17",
                                                    "reading_time_minutes": 3,
                                                    "url": "https://jecheck.io/en/docs/tasks/statuses"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/absences": {
            "get": {
                "operationId": "hrAbsencesList",
                "summary": "List absences",
                "description": "Vacations, sick leave and other absences of employees of the locations of `hr.absences` (the same records as in the shift schedule). Overlapping the period when `date_from`/`date_to` are given.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_absences_list",
                "x-permissions": [
                    "hr.absences"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Period start",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Period end",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status[]",
                        "in": "query",
                        "description": "pending, approved, rejected, cancelled (default — pending and approved)",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "type[]",
                        "in": "query",
                        "description": "Absence types: vacation, sick, day_off, unpaid, business_trip, study, maternity, truancy, other",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Only this employee",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only employees of these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only records changed after this moment",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "date_from": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "date_to": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "paid": {
                                                        "type": "boolean"
                                                    },
                                                    "comment": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "decision_note": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "decided_by": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "decided_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "has_file": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                            "user": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "type": "vacation",
                                            "date_from": "2026-12-01",
                                            "date_to": "2026-12-14",
                                            "days": 14,
                                            "status": "approved",
                                            "paid": true,
                                            "comment": null,
                                            "decision_note": null,
                                            "decided_by": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "decided_at": "2026-11-03T10:00:00+05:00",
                                            "has_file": false,
                                            "created_at": "2026-11-03T09:55:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "hrAbsencesCreate",
                "summary": "Add an absence",
                "description": "Records a vacation, sick leave etc. for an employee — approved immediately (requires `hr.absences` and `schedule.requests` on the employee's locations). With `release_shifts` the employee's shifts on those days become open shifts.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_absences_create",
                "x-permissions": [
                    "hr.absences"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer",
                                        "description": "Employee"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "vacation",
                                            "sick",
                                            "day_off",
                                            "unpaid",
                                            "business_trip",
                                            "study",
                                            "maternity",
                                            "truancy",
                                            "other"
                                        ]
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "paid": {
                                        "type": "boolean",
                                        "description": "Default — depends on the type"
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "release_shifts": {
                                        "type": "boolean"
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Sick note or order: PDF or image up to 10 MB"
                                    }
                                },
                                "required": [
                                    "user_id",
                                    "type",
                                    "date_from",
                                    "date_to"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer",
                                        "description": "Employee"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "vacation",
                                            "sick",
                                            "day_off",
                                            "unpaid",
                                            "business_trip",
                                            "study",
                                            "maternity",
                                            "truancy",
                                            "other"
                                        ]
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "paid": {
                                        "type": "boolean",
                                        "description": "Default — depends on the type"
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "release_shifts": {
                                        "type": "boolean"
                                    },
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "Sick note or order: PDF or image up to 10 MB"
                                    }
                                },
                                "required": [
                                    "user_id",
                                    "type",
                                    "date_from",
                                    "date_to"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "date_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "days": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "paid": {
                                                    "type": "boolean"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decision_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decided_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "decided_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "has_file": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "type": "vacation",
                                        "date_from": "2026-12-01",
                                        "date_to": "2026-12-14",
                                        "days": 14,
                                        "status": "approved",
                                        "paid": true,
                                        "comment": null,
                                        "decision_note": null,
                                        "decided_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "decided_at": "2026-11-03T10:00:00+05:00",
                                        "has_file": false,
                                        "created_at": "2026-11-03T09:55:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/absences/balances": {
            "get": {
                "operationId": "hrAbsencesBalances",
                "summary": "Get vacation balances",
                "description": "Annual vacation balance of each active employee of the locations of `hr.absences`: accrued since the hire date, used, planned, pending and available days.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_absences_balances",
                "x-permissions": [
                    "hr.absences"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only employees of these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "hired_at": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "per_year": {
                                                        "type": "integer"
                                                    },
                                                    "accrued": {
                                                        "type": "number"
                                                    },
                                                    "adjust": {
                                                        "type": "integer"
                                                    },
                                                    "used": {
                                                        "type": "integer"
                                                    },
                                                    "planned": {
                                                        "type": "integer"
                                                    },
                                                    "pending": {
                                                        "type": "integer"
                                                    },
                                                    "balance": {
                                                        "type": "number"
                                                    },
                                                    "available": {
                                                        "type": "number"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "user": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "hired_at": "2026-03-01",
                                            "per_year": 24,
                                            "accrued": 16.4,
                                            "adjust": 0,
                                            "used": 7,
                                            "planned": 14,
                                            "pending": 0,
                                            "balance": 9.4,
                                            "available": -4.6
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/absences/{uuid}": {
            "patch": {
                "operationId": "hrAbsencesUpdate",
                "summary": "Update an absence",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_absences_update",
                "x-permissions": [
                    "hr.absences"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Absence UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "vacation",
                                            "sick",
                                            "day_off",
                                            "unpaid",
                                            "business_trip",
                                            "study",
                                            "maternity",
                                            "truancy",
                                            "other"
                                        ]
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "paid": {
                                        "type": "boolean"
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "release_shifts": {
                                        "type": "boolean"
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                }
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "vacation",
                                            "sick",
                                            "day_off",
                                            "unpaid",
                                            "business_trip",
                                            "study",
                                            "maternity",
                                            "truancy",
                                            "other"
                                        ]
                                    },
                                    "date_from": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "date_to": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "paid": {
                                        "type": "boolean"
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "release_shifts": {
                                        "type": "boolean"
                                    },
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "date_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "days": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "paid": {
                                                    "type": "boolean"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decision_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decided_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "decided_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "has_file": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "type": "vacation",
                                        "date_from": "2026-12-01",
                                        "date_to": "2026-12-14",
                                        "days": 14,
                                        "status": "approved",
                                        "paid": true,
                                        "comment": null,
                                        "decision_note": null,
                                        "decided_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "decided_at": "2026-11-03T10:00:00+05:00",
                                        "has_file": false,
                                        "created_at": "2026-11-03T09:55:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/absences/{uuid}/cancel": {
            "post": {
                "operationId": "hrAbsencesCancel",
                "summary": "Cancel an absence",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_absences_cancel",
                "x-permissions": [
                    "hr.absences"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Absence UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "date_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "days": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "paid": {
                                                    "type": "boolean"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decision_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decided_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "decided_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "has_file": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "type": "vacation",
                                        "date_from": "2026-12-01",
                                        "date_to": "2026-12-14",
                                        "days": 14,
                                        "status": "approved",
                                        "paid": true,
                                        "comment": null,
                                        "decision_note": null,
                                        "decided_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "decided_at": "2026-11-03T10:00:00+05:00",
                                        "has_file": false,
                                        "created_at": "2026-11-03T09:55:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/absences/{uuid}/decide": {
            "post": {
                "operationId": "hrAbsencesDecide",
                "summary": "Approve or reject an absence request",
                "description": "Decision on a pending request submitted by an employee; the employee is notified.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_absences_decide",
                "x-permissions": [
                    "hr.absences"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Absence UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "approve": {
                                        "type": "boolean"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "release_shifts": {
                                        "type": "boolean",
                                        "description": "Open the employee's shifts on those days"
                                    }
                                },
                                "required": [
                                    "approve"
                                ]
                            },
                            "example": {
                                "approve": true,
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "release_shifts": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "date_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "days": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "paid": {
                                                    "type": "boolean"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decision_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "decided_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "decided_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "has_file": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "type": "vacation",
                                        "date_from": "2026-12-01",
                                        "date_to": "2026-12-14",
                                        "days": 14,
                                        "status": "approved",
                                        "paid": true,
                                        "comment": null,
                                        "decision_note": null,
                                        "decided_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "decided_at": "2026-11-03T10:00:00+05:00",
                                        "has_file": false,
                                        "created_at": "2026-11-03T09:55:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklist-items/{id}": {
            "patch": {
                "operationId": "hrChecklistsItemsUpdate",
                "summary": "Update a checklist item",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_items_update",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Item id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "assignee_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "section_key": {
                                        "type": "string",
                                        "maxLength": 16
                                    },
                                    "requires": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "comment",
                                            "file"
                                        ]
                                    }
                                }
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "assignee_id": 42,
                                "due_date": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "hrChecklistsItemsDelete",
                "summary": "Delete a checklist item",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_items_delete",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Item id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklist-items/{id}/status": {
            "post": {
                "operationId": "hrChecklistsItemsStatus",
                "summary": "Complete, skip or reopen a checklist item",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_items_status",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Item id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "complete",
                                            "skip",
                                            "reopen"
                                        ]
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Attachment when completing (if the item requires a file)"
                                    }
                                },
                                "required": [
                                    "action"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "complete",
                                            "skip",
                                            "reopen"
                                        ]
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "Attachment when completing (if the item requires a file)"
                                    }
                                },
                                "required": [
                                    "action"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklists": {
            "get": {
                "operationId": "hrChecklistsList",
                "summary": "List onboarding and offboarding checklists",
                "description": "Active checklists and those finished in the last 90 days, for employees of the locations of `hr.hire`.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_list",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "kind",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "onboarding",
                                "offboarding"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "completed",
                                "cancelled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "employee": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "sections": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "key": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "progress": {
                                                        "type": "object",
                                                        "properties": {
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "items": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "section_key": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                },
                                                                "description": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "assignee": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                },
                                                                "due_date": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "overdue": {
                                                                    "type": "boolean"
                                                                },
                                                                "status": {
                                                                    "type": "string"
                                                                },
                                                                "requires": {
                                                                    "type": "string"
                                                                },
                                                                "required": {
                                                                    "type": "boolean"
                                                                },
                                                                "comment": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "has_file": {
                                                                    "type": "boolean"
                                                                },
                                                                "done_by": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "done_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "task_uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "completed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                            "kind": "onboarding",
                                            "title": "Onboarding: Aigerim Sadykova",
                                            "start_date": "2026-11-04",
                                            "status": "active",
                                            "employee": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "sections": [
                                                {
                                                    "key": "s1",
                                                    "title": "Before the first day"
                                                }
                                            ],
                                            "progress": {
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            },
                                            "items": [
                                                {
                                                    "id": 7001,
                                                    "section_key": "s1",
                                                    "title": "Prepare a uniform",
                                                    "description": null,
                                                    "assignee": {
                                                        "id": 120,
                                                        "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                        "name": "Daniyar Omarov"
                                                    },
                                                    "due_date": "2026-11-03",
                                                    "overdue": true,
                                                    "status": "open",
                                                    "requires": "none",
                                                    "required": true,
                                                    "comment": null,
                                                    "has_file": false,
                                                    "done_by": null,
                                                    "done_at": null,
                                                    "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                }
                                            ],
                                            "created_at": "2026-10-30T12:00:00+05:00",
                                            "completed_at": null
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklists/{uuid}": {
            "get": {
                "operationId": "hrChecklistsGet",
                "summary": "Retrieve a checklist",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_get",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Checklist UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklists/{uuid}/cancel": {
            "post": {
                "operationId": "hrChecklistsCancel",
                "summary": "Cancel a checklist",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_cancel",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Checklist UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklists/{uuid}/items": {
            "post": {
                "operationId": "hrChecklistsItemsCreate",
                "summary": "Add a checklist item",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_items_create",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Checklist UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "assignee_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "section_key": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 16
                                    },
                                    "requires": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "comment",
                                            "file"
                                        ],
                                        "description": "What is required to complete the item"
                                    },
                                    "create_task": {
                                        "type": "boolean",
                                        "description": "Create a task for the assignee"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "assignee_id": 42,
                                "due_date": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/checklists/{uuid}/reschedule": {
            "post": {
                "operationId": "hrChecklistsReschedule",
                "summary": "Move the start date of a checklist",
                "description": "Moves the first working day / last day; due dates of open items shift by the same number of days.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_checklists_reschedule",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Checklist UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "date": {
                                        "type": "string",
                                        "format": "date"
                                    }
                                },
                                "required": [
                                    "date"
                                ]
                            },
                            "example": {
                                "date": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}": {
            "get": {
                "operationId": "hrEmployeesGet",
                "summary": "Retrieve an employee HR card",
                "description": "Work data, HR history, vacation balance, absences, documents and onboarding / offboarding checklists of an employee. Sections the token has no permission for are empty or `null` on the employee's locations: HR data — `hr.card`, personal data — `hr.personal`, documents — `hr.documents`, pay — `pay.rates.view`, contacts — `users.contacts`. Each view of sensitive data is written to the access log.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_get",
                "x-permissions": [
                    "users.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/cancel-dismissal": {
            "post": {
                "operationId": "hrEmployeesCancelDismissal",
                "summary": "Cancel a dismissal",
                "description": "The employee stays: dismissal dates and the offboarding checklist are removed, access is restored.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_cancel_dismissal",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/checklists": {
            "post": {
                "operationId": "hrEmployeesChecklistsStart",
                "summary": "Start a checklist for an employee",
                "description": "Starts an onboarding or offboarding checklist from a template manually (tasks are created for the responsible people).",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_checklists_start",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "template_id": {
                                        "type": "integer"
                                    },
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "First working day / last day"
                                    }
                                },
                                "required": [
                                    "template_id",
                                    "date"
                                ]
                            },
                            "example": {
                                "template_id": 42,
                                "date": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "done_by": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "task_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                        "kind": "onboarding",
                                        "title": "Onboarding: Aigerim Sadykova",
                                        "start_date": "2026-11-04",
                                        "status": "active",
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "progress": {
                                            "done": 3,
                                            "total": 9,
                                            "overdue": 1
                                        },
                                        "items": [
                                            {
                                                "id": 7001,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "due_date": "2026-11-03",
                                                "overdue": true,
                                                "status": "open",
                                                "requires": "none",
                                                "required": true,
                                                "comment": null,
                                                "has_file": false,
                                                "done_by": null,
                                                "done_at": null,
                                                "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            }
                                        ],
                                        "created_at": "2026-10-30T12:00:00+05:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/dismiss": {
            "post": {
                "operationId": "hrEmployeesDismiss",
                "summary": "Dismiss an employee",
                "description": "Registers the dismissal with the last working day and reason, cancels future absences and the active onboarding, starts the offboarding checklist. The account is closed the day after the last day (or now with `block_now`).",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_dismiss",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "last_day": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "reason": {
                                        "type": "string",
                                        "enum": [
                                            "own",
                                            "agreement",
                                            "contract_end",
                                            "employer",
                                            "probation",
                                            "discipline",
                                            "relocation",
                                            "other"
                                        ]
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "rehire": {
                                        "type": "boolean",
                                        "description": "Can be hired again, default true"
                                    },
                                    "template_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Offboarding template; 0 — no checklist"
                                    },
                                    "block_now": {
                                        "type": "boolean",
                                        "description": "Close the account immediately"
                                    }
                                },
                                "required": [
                                    "last_day",
                                    "reason"
                                ]
                            },
                            "example": {
                                "last_day": "2026-11-01",
                                "reason": "own",
                                "comment": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "rehire": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/documents": {
            "get": {
                "operationId": "hrDocumentsList",
                "summary": "List HR documents of an employee",
                "description": "Contracts, orders, IDs, certificates (plus medical books from HACCP, read-only). Each view is written to the access log.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_documents_list",
                "x-permissions": [
                    "hr.documents"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "issued_at": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "expires_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "note": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "source": {
                                                        "type": "string"
                                                    },
                                                    "file": {
                                                        "type": "object",
                                                        "properties": {
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "download_url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 88,
                                            "type": "contract",
                                            "title": "Employment contract",
                                            "number": "TD-2026/114",
                                            "issued_at": "2026-03-01",
                                            "expires_at": null,
                                            "note": null,
                                            "source": "hr",
                                            "file": {
                                                "name": "contract.pdf",
                                                "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "hrDocumentsCreate",
                "summary": "Add an HR document",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_documents_create",
                "x-permissions": [
                    "hr.documents"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "contract",
                                            "addendum",
                                            "order",
                                            "id",
                                            "medical",
                                            "certificate",
                                            "diploma",
                                            "nda",
                                            "consent",
                                            "other"
                                        ]
                                    },
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "issued_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "expires_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Scan: PDF, image, Office or TXT, up to 20 MB"
                                    }
                                },
                                "required": [
                                    "type"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "contract",
                                            "addendum",
                                            "order",
                                            "id",
                                            "medical",
                                            "certificate",
                                            "diploma",
                                            "nda",
                                            "consent",
                                            "other"
                                        ]
                                    },
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "issued_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "expires_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "Scan: PDF, image, Office or TXT, up to 20 MB"
                                    }
                                },
                                "required": [
                                    "type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "issued_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "file": {
                                                    "type": "object",
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "download_url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 88,
                                        "type": "contract",
                                        "title": "Employment contract",
                                        "number": "TD-2026/114",
                                        "issued_at": "2026-03-01",
                                        "expires_at": null,
                                        "note": null,
                                        "source": "hr",
                                        "file": {
                                            "name": "contract.pdf",
                                            "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/documents/{id}": {
            "patch": {
                "operationId": "hrDocumentsUpdate",
                "summary": "Update an HR document",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_documents_update",
                "x-permissions": [
                    "hr.documents"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Document id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "contract",
                                            "addendum",
                                            "order",
                                            "id",
                                            "medical",
                                            "certificate",
                                            "diploma",
                                            "nda",
                                            "consent",
                                            "other"
                                        ]
                                    },
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "issued_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "expires_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Replace the scan"
                                    }
                                }
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "contract",
                                            "addendum",
                                            "order",
                                            "id",
                                            "medical",
                                            "certificate",
                                            "diploma",
                                            "nda",
                                            "consent",
                                            "other"
                                        ]
                                    },
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "issued_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "expires_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        },
                                        "description": "Replace the scan"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "issued_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "file": {
                                                    "type": "object",
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "download_url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 88,
                                        "type": "contract",
                                        "title": "Employment contract",
                                        "number": "TD-2026/114",
                                        "issued_at": "2026-03-01",
                                        "expires_at": null,
                                        "note": null,
                                        "source": "hr",
                                        "file": {
                                            "name": "contract.pdf",
                                            "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "hrDocumentsDelete",
                "summary": "Delete an HR document",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_documents_delete",
                "x-permissions": [
                    "hr.documents"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Document id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/documents/{id}/file": {
            "get": {
                "operationId": "hrDocumentsDownload",
                "summary": "Download an HR document file",
                "description": "Returns the file itself (REST only, not available as an MCP tool). The download is written to the access log.",
                "tags": [
                    "HR"
                ],
                "x-permissions": [
                    "hr.documents"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Document id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "file": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "file": "binary"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/notes": {
            "post": {
                "operationId": "hrEmployeesNotesCreate",
                "summary": "Add a note to the HR history",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_notes_create",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "date": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "comment": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 1000
                                    },
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    }
                                },
                                "required": [
                                    "date",
                                    "comment"
                                ]
                            },
                            "example": {
                                "date": "2026-11-01",
                                "comment": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "title": "Replace the broken fridge seal"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "comment": {
                                                    "type": "string"
                                                },
                                                "created_by": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 502,
                                        "type": "note",
                                        "date": "2026-11-03",
                                        "data": {
                                            "title": "Warning"
                                        },
                                        "comment": "Late three times this month",
                                        "created_by": "Daniyar Omarov",
                                        "created_at": "2026-11-03T10:00:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/notes/{id}": {
            "delete": {
                "operationId": "hrEmployeesNotesDelete",
                "summary": "Delete a note from the HR history",
                "description": "Only notes can be deleted; hiring and dismissal are undone by their own operations.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_notes_delete",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Event id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/profile": {
            "patch": {
                "operationId": "hrEmployeesProfileUpdate",
                "summary": "Update personal data",
                "description": "Partial update of the employee profile. Name and other fields require `users.edit`, phone — `users.contacts`, personal data (documents, addresses, tax id, bank, emergency contact, family, custom fields) — `hr.personal`, all on the employee's locations.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_profile_update",
                "x-permissions": [
                    "users.view"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "First name (`users.edit`)",
                                        "minLength": 2,
                                        "maxLength": 255
                                    },
                                    "lastname": {
                                        "type": "string",
                                        "description": "Last name (`users.edit`)",
                                        "minLength": 2,
                                        "maxLength": 512
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Phone (`users.contacts`)",
                                        "maxLength": 64
                                    },
                                    "middle_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "work_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "education": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "languages": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "clothing_size": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 16
                                    },
                                    "shoe_size": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 8
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "gender": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "male",
                                            "female"
                                        ],
                                        "description": "Personal data (`hr.personal`)"
                                    },
                                    "birth_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Personal data (`hr.personal`)"
                                    },
                                    "birth_place": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "citizenship": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "marital_status": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "single",
                                            "married",
                                            "divorced",
                                            "widowed"
                                        ]
                                    },
                                    "children": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 30
                                    },
                                    "personal_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "personal_email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "address_actual": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "address_registered": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "tax_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "insurance_no": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "id_doc_type": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "id_card",
                                            "passport",
                                            "foreign",
                                            "residence"
                                        ]
                                    },
                                    "id_doc_number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "id_doc_issuer": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "id_doc_issued_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "id_doc_expires_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "emergency_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "emergency_relation": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "emergency_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "bank_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "bank_account": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "custom": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Company custom fields: {key: value} (see `hr.settings.get`)"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "lastname": "string",
                                "phone": "+77010000000",
                                "middle_name": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/rehire": {
            "post": {
                "operationId": "hrEmployeesRehire",
                "summary": "Rehire a former employee",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_rehire",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "hired_at": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "position_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "home_location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "work_anywhere": {
                                        "type": "boolean"
                                    },
                                    "manager_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "template_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    }
                                },
                                "required": [
                                    "hired_at"
                                ]
                            },
                            "example": {
                                "hired_at": "2026-11-01",
                                "position_id": 42,
                                "home_location_id": 12,
                                "location_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/transfer": {
            "post": {
                "operationId": "hrEmployeesTransfer",
                "summary": "Transfer an employee",
                "description": "Changes position, locations or manager; the change is recorded in the HR history with the before/after values.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_transfer",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Effective date"
                                    },
                                    "position_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "home_location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "work_anywhere": {
                                        "type": "boolean"
                                    },
                                    "manager_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    }
                                },
                                "required": [
                                    "date"
                                ]
                            },
                            "example": {
                                "date": "2026-11-01",
                                "position_id": 42,
                                "home_location_id": 12,
                                "location_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/employees/{uuid}/work": {
            "patch": {
                "operationId": "hrEmployeesWorkUpdate",
                "summary": "Update work data",
                "description": "Hire date, personnel number, employment type, probation, manager, contract, vacation entitlement (`hr.hire`) and pay (`pay.rates.edit`; a new rate with `rate_from` goes to the rate history used by payroll).",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_employees_work_update",
                "x-permissions": [
                    "hr.hire",
                    "pay.rates.edit"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Employee UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "hired_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "personnel_no": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    },
                                    "employment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "full",
                                            "part",
                                            "contract",
                                            "intern"
                                        ]
                                    },
                                    "probation_until": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "manager_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Line manager (user id)"
                                    },
                                    "contract_type": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "permanent",
                                            "fixed",
                                            "civil",
                                            "self"
                                        ]
                                    },
                                    "contract_number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "contract_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "contract_until": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "vacation_days": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Personal annual vacation days (null — company default)",
                                        "minimum": 0,
                                        "maximum": 120
                                    },
                                    "vacation_adjust": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "description": "Manual vacation balance correction, days",
                                        "minimum": -365,
                                        "maximum": 365
                                    },
                                    "pay_type": {
                                        "type": "string",
                                        "enum": [
                                            "hourly",
                                            "salary",
                                            "shift"
                                        ]
                                    },
                                    "rate": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 100000000
                                    },
                                    "rate_from": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Rate effective from"
                                    },
                                    "kpi_bonus": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 100000000
                                    },
                                    "kpi_bonus_type": {
                                        "type": "string",
                                        "enum": [
                                            "fixed",
                                            "percent"
                                        ]
                                    }
                                }
                            },
                            "example": {
                                "hired_at": "2026-11-01",
                                "personnel_no": "string",
                                "employment": "full",
                                "probation_until": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/hire": {
            "post": {
                "operationId": "hrHire",
                "summary": "Hire an employee",
                "description": "Creates the employee account (or hires an existing user by `uuid`), sets position, locations, manager and work data, and starts an onboarding checklist (`template_id`; default — the template for the position, 0 — none). Requires `hr.hire` and, for a new account, `users.create`; with a location-scoped `hr.hire` only your locations can be chosen.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_hire",
                "x-permissions": [
                    "hr.hire"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Existing user of the company to hire (instead of creating a new account)"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "First name (new account)",
                                        "maxLength": 255
                                    },
                                    "lastname": {
                                        "type": "string",
                                        "description": "Last name (new account)",
                                        "maxLength": 512
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Login email (new account)",
                                        "maxLength": 255
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "middle_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "gender": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "male",
                                            "female"
                                        ]
                                    },
                                    "birth_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "personal_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "position_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "home_location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Main location"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Additional locations"
                                    },
                                    "work_anywhere": {
                                        "type": "boolean",
                                        "description": "Works at all locations (requires `hr.hire` for all locations)"
                                    },
                                    "team_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "manager_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "hired_at": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "First working day"
                                    },
                                    "probation_until": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "employment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "full",
                                            "part",
                                            "contract",
                                            "intern"
                                        ]
                                    },
                                    "personnel_no": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    },
                                    "contract_type": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "permanent",
                                            "fixed",
                                            "civil",
                                            "self"
                                        ]
                                    },
                                    "contract_number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "contract_until": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "web_access": {
                                        "type": "boolean",
                                        "description": "Access to the web cabinet (requires `users.access`)"
                                    },
                                    "role_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Access roles for the new account (only roles you may assign)"
                                    },
                                    "invite": {
                                        "type": "string",
                                        "enum": [
                                            "now",
                                            "start",
                                            "none"
                                        ],
                                        "description": "Send the invitation now, on the first working day or never (default `now`)"
                                    },
                                    "template_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Onboarding checklist template; 0 — no checklist"
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    }
                                },
                                "required": [
                                    "hired_at"
                                ]
                            },
                            "example": {
                                "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                "name": "Replace the broken fridge seal",
                                "lastname": "string",
                                "email": "anna@example.com",
                                "hired_at": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "employee": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "lastname": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "deleted_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "web_access": {
                                                            "type": "boolean"
                                                        },
                                                        "position": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "kind": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "home_location_id": {
                                                            "type": "integer"
                                                        },
                                                        "work_anywhere": {
                                                            "type": "boolean"
                                                        },
                                                        "teams": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "is_head": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "last_seen_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "absence_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "onboarding": {
                                                            "type": "object",
                                                            "properties": {
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "kind": {
                                                                    "type": "string"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                },
                                                                "total": {
                                                                    "type": "integer"
                                                                },
                                                                "overdue": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "middle_name": {
                                                            "type": "string"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "birth_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "birth_place": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "citizenship": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "marital_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "children": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "work_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personal_phone": {
                                                            "type": "string"
                                                        },
                                                        "personal_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_actual": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "address_registered": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "tax_id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "insurance_no": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_type": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_number": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issuer": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_issued_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "id_doc_expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_relation": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "emergency_phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "bank_account": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "education": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "languages": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "clothing_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "shoe_size": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "custom": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "work": {
                                                    "type": "object",
                                                    "properties": {
                                                        "hired_at": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "fired_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "personnel_no": {
                                                            "type": "string"
                                                        },
                                                        "employment": {
                                                            "type": "string"
                                                        },
                                                        "probation_until": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_type": {
                                                            "type": "string"
                                                        },
                                                        "contract_number": {
                                                            "type": "string"
                                                        },
                                                        "contract_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "contract_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_days": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "vacation_adjust": {
                                                            "type": "integer"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "team_managers": {
                                                            "type": "array"
                                                        },
                                                        "reports": {
                                                            "type": "array"
                                                        }
                                                    }
                                                },
                                                "pay": {
                                                    "type": "object",
                                                    "properties": {
                                                        "pay_type": {
                                                            "type": "string"
                                                        },
                                                        "rate": {
                                                            "type": "integer"
                                                        },
                                                        "kpi_bonus": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "kpi_bonus_type": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "history": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "from": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    },
                                                                    "pay_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "rate": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "vacation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "per_year": {
                                                            "type": "integer"
                                                        },
                                                        "accrued": {
                                                            "type": "number"
                                                        },
                                                        "adjust": {
                                                            "type": "integer"
                                                        },
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        },
                                                        "pending": {
                                                            "type": "integer"
                                                        },
                                                        "balance": {
                                                            "type": "number"
                                                        },
                                                        "available": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "absences": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date_from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "date_to": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "paid": {
                                                                "type": "boolean"
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decision_note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "decided_by": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "decided_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "has_file": {
                                                                "type": "boolean"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "data": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "position": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "comment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_by": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "issued_at": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            },
                                                            "file": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "download_url": {
                                                                        "type": "string",
                                                                        "format": "uri"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "checklists": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "start_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "employee": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "progress": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "done": {
                                                                        "type": "integer"
                                                                    },
                                                                    "total": {
                                                                        "type": "integer"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_key": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "assignee": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "due_date": {
                                                                            "type": "string",
                                                                            "format": "date"
                                                                        },
                                                                        "overdue": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "status": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "has_file": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "done_by": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "done_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "task_uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "completed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "contacts": {
                                                            "type": "boolean"
                                                        },
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "card": {
                                                            "type": "boolean"
                                                        },
                                                        "personal": {
                                                            "type": "boolean"
                                                        },
                                                        "documents": {
                                                            "type": "boolean"
                                                        },
                                                        "hire": {
                                                            "type": "boolean"
                                                        },
                                                        "absences": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_view": {
                                                            "type": "boolean"
                                                        },
                                                        "pay_edit": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "employee": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim",
                                            "lastname": "Sadykova",
                                            "email": "aigerim@example.com",
                                            "phone": "+7 701 111 22 33",
                                            "is_admin": false,
                                            "deleted": false,
                                            "deleted_at": null,
                                            "web_access": false,
                                            "position": {
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave",
                                                    "kind": "home"
                                                }
                                            ],
                                            "home_location_id": 12,
                                            "work_anywhere": false,
                                            "teams": [
                                                {
                                                    "id": 3,
                                                    "name": "Bar",
                                                    "is_head": false
                                                }
                                            ],
                                            "created_at": "2026-03-01T09:00:00+05:00",
                                            "last_seen_at": "2026-11-03T08:12:00+05:00",
                                            "url": "https://app.jecheck.io/ui/users/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b"
                                        },
                                        "status": {
                                            "status": "probation",
                                            "until": "2026-12-01",
                                            "absence_type": null,
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "onboarding": {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "done": 3,
                                                "total": 9,
                                                "overdue": 1
                                            }
                                        },
                                        "profile": {
                                            "middle_name": "Nurlanovna",
                                            "gender": "female",
                                            "birth_date": "1998-04-12",
                                            "birth_place": null,
                                            "citizenship": null,
                                            "marital_status": null,
                                            "children": null,
                                            "work_phone": null,
                                            "personal_phone": "+7 701 000 00 00",
                                            "personal_email": null,
                                            "address_actual": null,
                                            "address_registered": null,
                                            "tax_id": null,
                                            "insurance_no": null,
                                            "id_doc_type": null,
                                            "id_doc_number": null,
                                            "id_doc_issuer": null,
                                            "id_doc_issued_at": null,
                                            "id_doc_expires_at": null,
                                            "emergency_name": null,
                                            "emergency_relation": null,
                                            "emergency_phone": null,
                                            "bank_name": null,
                                            "bank_account": null,
                                            "education": null,
                                            "languages": null,
                                            "clothing_size": null,
                                            "shoe_size": null,
                                            "note": null,
                                            "custom": {}
                                        },
                                        "work": {
                                            "hired_at": "2026-09-01",
                                            "fired_at": null,
                                            "personnel_no": "0114",
                                            "employment": "full",
                                            "probation_until": "2026-12-01",
                                            "contract_type": "permanent",
                                            "contract_number": "TD-2026/114",
                                            "contract_date": "2026-09-01",
                                            "contract_until": null,
                                            "vacation_days": null,
                                            "vacation_adjust": 0,
                                            "manager": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "team_managers": [],
                                            "reports": []
                                        },
                                        "pay": {
                                            "pay_type": "hourly",
                                            "rate": 1500,
                                            "kpi_bonus": null,
                                            "kpi_bonus_type": "fixed",
                                            "currency": "KZT",
                                            "history": [
                                                {
                                                    "from": "2026-09-01",
                                                    "pay_type": "hourly",
                                                    "rate": 1500
                                                }
                                            ]
                                        },
                                        "vacation": {
                                            "per_year": 24,
                                            "accrued": 4.1,
                                            "adjust": 0,
                                            "used": 0,
                                            "planned": 0,
                                            "pending": 0,
                                            "balance": 4.1,
                                            "available": 4.1
                                        },
                                        "absences": [
                                            {
                                                "uuid": "2b3c4d5e-6f70-4a81-92b3-c4d5e6f7a8b9",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "type": "vacation",
                                                "date_from": "2026-12-01",
                                                "date_to": "2026-12-14",
                                                "days": 14,
                                                "status": "approved",
                                                "paid": true,
                                                "comment": null,
                                                "decision_note": null,
                                                "decided_by": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "decided_at": "2026-11-03T10:00:00+05:00",
                                                "has_file": false,
                                                "created_at": "2026-11-03T09:55:00+05:00"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 501,
                                                "type": "hire",
                                                "date": "2026-09-01",
                                                "data": {
                                                    "position": "Barista"
                                                },
                                                "comment": null,
                                                "created_by": "Daniyar Omarov",
                                                "created_at": "2026-08-28T10:00:00+05:00"
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "id": 88,
                                                "type": "contract",
                                                "title": "Employment contract",
                                                "number": "TD-2026/114",
                                                "issued_at": "2026-03-01",
                                                "expires_at": null,
                                                "note": null,
                                                "source": "hr",
                                                "file": {
                                                    "name": "contract.pdf",
                                                    "download_url": "https://app.jecheck.io/api/ext/v1/hr/employees/1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b/documents/88/file"
                                                }
                                            }
                                        ],
                                        "checklists": [
                                            {
                                                "uuid": "4d5e6f70-8192-4a3b-8c4d-5e6f708192a3",
                                                "kind": "onboarding",
                                                "title": "Onboarding: Aigerim Sadykova",
                                                "start_date": "2026-11-04",
                                                "status": "active",
                                                "employee": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "sections": [
                                                    {
                                                        "key": "s1",
                                                        "title": "Before the first day"
                                                    }
                                                ],
                                                "progress": {
                                                    "done": 3,
                                                    "total": 9,
                                                    "overdue": 1
                                                },
                                                "items": [
                                                    {
                                                        "id": 7001,
                                                        "section_key": "s1",
                                                        "title": "Prepare a uniform",
                                                        "description": null,
                                                        "assignee": {
                                                            "id": 120,
                                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                            "name": "Daniyar Omarov"
                                                        },
                                                        "due_date": "2026-11-03",
                                                        "overdue": true,
                                                        "status": "open",
                                                        "requires": "none",
                                                        "required": true,
                                                        "comment": null,
                                                        "has_file": false,
                                                        "done_by": null,
                                                        "done_at": null,
                                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                                    }
                                                ],
                                                "created_at": "2026-10-30T12:00:00+05:00",
                                                "completed_at": null
                                            }
                                        ],
                                        "can": {
                                            "contacts": true,
                                            "edit": true,
                                            "card": true,
                                            "personal": true,
                                            "documents": true,
                                            "hire": true,
                                            "absences": true,
                                            "pay_view": true,
                                            "pay_edit": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/settings": {
            "get": {
                "operationId": "hrSettingsGet",
                "summary": "Get HR settings",
                "description": "Company defaults: annual vacation days, probation months, closing the account on dismissal, custom profile fields.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_settings_get",
                "x-permissions": [
                    "hr.card",
                    "hr.onboarding"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "vacation_days": {
                                                    "type": "integer"
                                                },
                                                "probation_months": {
                                                    "type": "integer"
                                                },
                                                "block_on_dismissal": {
                                                    "type": "boolean"
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "options": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "vacation_days": 24,
                                        "probation_months": 3,
                                        "block_on_dismissal": true,
                                        "custom_fields": [
                                            {
                                                "key": "locker",
                                                "label": "Locker no.",
                                                "type": "text",
                                                "options": []
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "hrSettingsUpdate",
                "summary": "Update HR settings",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_settings_update",
                "x-permissions": [
                    "hr.onboarding"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "vacation_days": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 120
                                    },
                                    "probation_months": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 12
                                    },
                                    "block_on_dismissal": {
                                        "type": "boolean"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "maxLength": 24
                                                },
                                                "label": {
                                                    "type": "string",
                                                    "maxLength": 80
                                                },
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "text",
                                                        "date",
                                                        "number",
                                                        "select"
                                                    ]
                                                },
                                                "options": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "label",
                                                "type"
                                            ]
                                        },
                                        "description": "Replaces the custom field list",
                                        "maxItems": 30
                                    }
                                }
                            },
                            "example": {
                                "vacation_days": 42,
                                "probation_months": 42,
                                "block_on_dismissal": true,
                                "custom_fields": [
                                    {
                                        "key": "string",
                                        "label": "string",
                                        "type": "text"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "vacation_days": {
                                                    "type": "integer"
                                                },
                                                "probation_months": {
                                                    "type": "integer"
                                                },
                                                "block_on_dismissal": {
                                                    "type": "boolean"
                                                },
                                                "custom_fields": {
                                                    "type": "array"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "vacation_days": 24,
                                        "probation_months": 3,
                                        "block_on_dismissal": true,
                                        "custom_fields": []
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/templates": {
            "get": {
                "operationId": "hrTemplatesList",
                "summary": "List checklist templates",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_templates_list",
                "x-permissions": [
                    "hr.hire",
                    "hr.onboarding"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "position_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "is_default": {
                                                        "type": "boolean"
                                                    },
                                                    "sections": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "key": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "items": {
                                                        "type": "array"
                                                    },
                                                    "items_count": {
                                                        "type": "integer"
                                                    },
                                                    "used": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 4,
                                            "kind": "onboarding",
                                            "name": "Barista onboarding",
                                            "description": null,
                                            "color": "#1f9d63",
                                            "position_ids": [
                                                7
                                            ],
                                            "is_default": true,
                                            "sections": [
                                                {
                                                    "key": "s1",
                                                    "title": "Before the first day"
                                                }
                                            ],
                                            "items": [],
                                            "items_count": 9,
                                            "used": 14
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "hrTemplatesCreate",
                "summary": "Create a checklist template",
                "description": "Sections are stages (\"Before the first day\", \"First week\"…); items reference a section by `section_key`. Assignee types: `user` (assignee_id — user id), `position` (assignee_id — position id), `manager` (line manager), `location_manager`, `employee` (the employee themselves), `initiator` (who starts the checklist); `due_offset` — days from the start date (negative — before).",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_templates_create",
                "x-permissions": [
                    "hr.onboarding"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 160
                                    },
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "onboarding",
                                            "offboarding"
                                        ]
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 9
                                    },
                                    "position_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Used by default for these positions"
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Default template of its kind"
                                    },
                                    "sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "maxLength": 16
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                }
                                            },
                                            "required": [
                                                "key",
                                                "title"
                                            ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "section_key": {
                                                    "type": "string",
                                                    "maxLength": 16
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 2000
                                                },
                                                "assignee_type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "manager",
                                                        "location_manager",
                                                        "employee",
                                                        "initiator"
                                                    ]
                                                },
                                                "assignee_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "due_offset": {
                                                    "type": "integer",
                                                    "minimum": -365,
                                                    "maximum": 365
                                                },
                                                "requires": {
                                                    "type": "string",
                                                    "enum": [
                                                        "none",
                                                        "comment",
                                                        "file"
                                                    ]
                                                },
                                                "required": {
                                                    "type": "boolean"
                                                },
                                                "create_task": {
                                                    "type": "boolean"
                                                },
                                                "position_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "section_key",
                                                "title"
                                            ]
                                        },
                                        "maxItems": 200
                                    }
                                },
                                "required": [
                                    "name",
                                    "kind",
                                    "sections"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "kind": "onboarding",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "color": "string",
                                "sections": [
                                    {
                                        "key": "string",
                                        "title": "Replace the broken fridge seal"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "position_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee_type": {
                                                                "type": "string"
                                                            },
                                                            "assignee_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_offset": {
                                                                "type": "integer"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "create_task": {
                                                                "type": "boolean"
                                                            },
                                                            "position_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "used": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 4,
                                        "kind": "onboarding",
                                        "name": "Barista onboarding",
                                        "description": null,
                                        "color": "#1f9d63",
                                        "position_ids": [
                                            7
                                        ],
                                        "is_default": true,
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "items": [
                                            {
                                                "id": 31,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee_type": "location_manager",
                                                "assignee_id": null,
                                                "due_offset": -1,
                                                "requires": "none",
                                                "required": true,
                                                "create_task": true,
                                                "position_ids": []
                                            }
                                        ],
                                        "items_count": 1,
                                        "used": 14
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/templates/{id}": {
            "get": {
                "operationId": "hrTemplatesGet",
                "summary": "Retrieve a checklist template",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_templates_get",
                "x-permissions": [
                    "hr.onboarding"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Template id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "position_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee_type": {
                                                                "type": "string"
                                                            },
                                                            "assignee_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_offset": {
                                                                "type": "integer"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "create_task": {
                                                                "type": "boolean"
                                                            },
                                                            "position_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "used": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 4,
                                        "kind": "onboarding",
                                        "name": "Barista onboarding",
                                        "description": null,
                                        "color": "#1f9d63",
                                        "position_ids": [
                                            7
                                        ],
                                        "is_default": true,
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "items": [
                                            {
                                                "id": 31,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee_type": "location_manager",
                                                "assignee_id": null,
                                                "due_offset": -1,
                                                "requires": "none",
                                                "required": true,
                                                "create_task": true,
                                                "position_ids": []
                                            }
                                        ],
                                        "items_count": 1,
                                        "used": 14
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "hrTemplatesUpdate",
                "summary": "Replace a checklist template",
                "description": "Saves the whole template (sections and all items). Running checklists keep their own copy of items.",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_templates_update",
                "x-permissions": [
                    "hr.onboarding"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Template id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 160
                                    },
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "onboarding",
                                            "offboarding"
                                        ]
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 9
                                    },
                                    "position_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Used by default for these positions"
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Default template of its kind"
                                    },
                                    "sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "maxLength": 16
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "maxLength": 120
                                                }
                                            },
                                            "required": [
                                                "key",
                                                "title"
                                            ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "section_key": {
                                                    "type": "string",
                                                    "maxLength": 16
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 2000
                                                },
                                                "assignee_type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "manager",
                                                        "location_manager",
                                                        "employee",
                                                        "initiator"
                                                    ]
                                                },
                                                "assignee_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "due_offset": {
                                                    "type": "integer",
                                                    "minimum": -365,
                                                    "maximum": 365
                                                },
                                                "requires": {
                                                    "type": "string",
                                                    "enum": [
                                                        "none",
                                                        "comment",
                                                        "file"
                                                    ]
                                                },
                                                "required": {
                                                    "type": "boolean"
                                                },
                                                "create_task": {
                                                    "type": "boolean"
                                                },
                                                "position_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "section_key",
                                                "title"
                                            ]
                                        },
                                        "maxItems": 200
                                    }
                                },
                                "required": [
                                    "name",
                                    "kind",
                                    "sections"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "kind": "onboarding",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "color": "string",
                                "sections": [
                                    {
                                        "key": "string",
                                        "title": "Replace the broken fridge seal"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "position_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee_type": {
                                                                "type": "string"
                                                            },
                                                            "assignee_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_offset": {
                                                                "type": "integer"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "create_task": {
                                                                "type": "boolean"
                                                            },
                                                            "position_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "used": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 4,
                                        "kind": "onboarding",
                                        "name": "Barista onboarding",
                                        "description": null,
                                        "color": "#1f9d63",
                                        "position_ids": [
                                            7
                                        ],
                                        "is_default": true,
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "items": [
                                            {
                                                "id": 31,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee_type": "location_manager",
                                                "assignee_id": null,
                                                "due_offset": -1,
                                                "requires": "none",
                                                "required": true,
                                                "create_task": true,
                                                "position_ids": []
                                            }
                                        ],
                                        "items_count": 1,
                                        "used": 14
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "hrTemplatesDelete",
                "summary": "Delete a checklist template",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_templates_delete",
                "x-permissions": [
                    "hr.onboarding"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Template id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/hr/templates/{id}/duplicate": {
            "post": {
                "operationId": "hrTemplatesDuplicate",
                "summary": "Duplicate a checklist template",
                "tags": [
                    "HR"
                ],
                "x-mcp-tool": "hr_templates_duplicate",
                "x-permissions": [
                    "hr.onboarding"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Template id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "position_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "is_default": {
                                                    "type": "boolean"
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "section_key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "assignee_type": {
                                                                "type": "string"
                                                            },
                                                            "assignee_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_offset": {
                                                                "type": "integer"
                                                            },
                                                            "requires": {
                                                                "type": "string"
                                                            },
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "create_task": {
                                                                "type": "boolean"
                                                            },
                                                            "position_ids": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "used": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 4,
                                        "kind": "onboarding",
                                        "name": "Barista onboarding",
                                        "description": null,
                                        "color": "#1f9d63",
                                        "position_ids": [
                                            7
                                        ],
                                        "is_default": true,
                                        "sections": [
                                            {
                                                "key": "s1",
                                                "title": "Before the first day"
                                            }
                                        ],
                                        "items": [
                                            {
                                                "id": 31,
                                                "section_key": "s1",
                                                "title": "Prepare a uniform",
                                                "description": null,
                                                "assignee_type": "location_manager",
                                                "assignee_id": null,
                                                "due_offset": -1,
                                                "requires": "none",
                                                "required": true,
                                                "create_task": true,
                                                "position_ids": []
                                            }
                                        ],
                                        "items_count": 1,
                                        "used": 14
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions": {
            "get": {
                "operationId": "instructionsList",
                "summary": "List instructions",
                "description": "Instructions visible to the acting user, in library order. Readers get published documents; editors also get drafts and archived documents they can edit (filter with `status`). Read status (`viewed`, `acknowledged`, `needs_ack`) is for the acting user.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "folder_id",
                        "in": "query",
                        "description": "Only documents directly in this folder",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "root",
                        "in": "query",
                        "description": "Only documents in the library root (no folder)",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search in title, text, summary and tags",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "status[]",
                        "in": "query",
                        "description": "Filter by status: draft, published, archived",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "`needs_ack` — waiting for the acting user's acknowledgement; `unread` — never opened by the acting user",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "needs_ack",
                                "unread"
                            ]
                        }
                    },
                    {
                        "name": "tags[]",
                        "in": "query",
                        "description": "Only documents with any of these tags",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only documents published (or, for editors, edited) after this moment — use for incremental sync",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "summary": {
                                                        "type": "string"
                                                    },
                                                    "folder_id": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "version": {
                                                        "type": "integer"
                                                    },
                                                    "published_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "require_ack": {
                                                        "type": "boolean"
                                                    },
                                                    "tags": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "words": {
                                                        "type": "integer"
                                                    },
                                                    "viewed": {
                                                        "type": "boolean"
                                                    },
                                                    "acknowledged": {
                                                        "type": "boolean"
                                                    },
                                                    "needs_ack": {
                                                        "type": "boolean"
                                                    },
                                                    "has_unpublished_changes": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "can_edit": {
                                                        "type": "boolean"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                            "title": "Opening the coffee shop",
                                            "icon": "coffee",
                                            "summary": "Morning checklist for baristas",
                                            "folder_id": 14,
                                            "status": "published",
                                            "version": 3,
                                            "published_at": "2026-10-28T09:12:00+05:00",
                                            "updated_at": "2026-10-28T09:12:00+05:00",
                                            "require_ack": true,
                                            "tags": [
                                                "Barista",
                                                "Opening"
                                            ],
                                            "words": 412,
                                            "viewed": true,
                                            "acknowledged": false,
                                            "needs_ack": true,
                                            "has_unpublished_changes": null,
                                            "can_edit": false,
                                            "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "instructionsCreate",
                "summary": "Create an instruction",
                "description": "Creates a draft in a folder where the acting user can edit (the library root — knowledge-base managers only). Content is converted to the editor format; pass `publish=true` to publish the first version right away (employees are notified).",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_create",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Title",
                                        "minLength": 1,
                                        "maxLength": 250
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "Body text",
                                        "maxLength": 500000
                                    },
                                    "content_format": {
                                        "type": "string",
                                        "enum": [
                                            "markdown",
                                            "html",
                                            "text"
                                        ],
                                        "description": "Format of `content`, default `markdown`. HTML is sanitised to text formatting, headings, lists, tables, quotes, code and links; add images and files with the upload operation"
                                    },
                                    "template": {
                                        "type": "string",
                                        "enum": [
                                            "sop",
                                            "opening",
                                            "sanitation",
                                            "equipment"
                                        ],
                                        "description": "Start from a built-in template (ignored when `content` is passed)"
                                    },
                                    "folder_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Folder id (null — library root, managers only). Moving requires edit rights on the target folder"
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    },
                                    "summary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Short description shown in the list",
                                        "maxLength": 500
                                    },
                                    "require_ack": {
                                        "type": "boolean",
                                        "description": "Employees must confirm they have read each major version"
                                    },
                                    "review_every_days": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Review period in days (null — no review reminders)",
                                        "minimum": 1,
                                        "maximum": 1095
                                    },
                                    "owner_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Responsible user id"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Tags (replace the current ones)",
                                        "maxItems": 20
                                    },
                                    "ai_visibility": {
                                        "type": "string",
                                        "enum": [
                                            "inherit",
                                            "none",
                                            "staff",
                                            "client"
                                        ],
                                        "description": "Visibility for the external AI knowledge base (only when the AI knowledge base is enabled for the company; managers only)"
                                    },
                                    "ai_note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Hint for the external AI (same conditions as `ai_visibility`)",
                                        "maxLength": 2000
                                    },
                                    "publish": {
                                        "type": "boolean",
                                        "description": "Publish the first version immediately"
                                    },
                                    "change_note": {
                                        "type": "string",
                                        "description": "Version note when publishing",
                                        "maxLength": 490
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "content": "string",
                                "content_format": "markdown",
                                "template": "sop"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/badge": {
            "get": {
                "operationId": "instructionsBadge",
                "summary": "Get my reading counters",
                "description": "Counters for the acting user over the published instructions they can read: total, never opened, and waiting for acknowledgement.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_badge",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "unread": {
                                                    "type": "integer"
                                                },
                                                "needs_ack": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "total": 42,
                                        "unread": 5,
                                        "needs_ack": 2
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/by-ref/{ref}": {
            "get": {
                "operationId": "instructionsByRef",
                "summary": "Find an instruction by external reference",
                "description": "Resolves an external reference (for example `confluence:12345` for pages imported from Confluence) to the instruction UUID — use it to redirect old links.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_by_ref",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "ref",
                        "in": "path",
                        "required": true,
                        "description": "External reference, e.g. `confluence:12345`",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/changes": {
            "get": {
                "operationId": "instructionsChanges",
                "summary": "List instruction changes",
                "description": "Change feed for mirrors and caches, oldest first: every document of the company changed after `updated_since`, with `state` = `active` (published and readable by the acting user) or `removed` (deleted, archived, unpublished or no longer visible). Store the last `updated_at` and pass it as `updated_since` next time.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_changes",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only changes after this moment; omit for a full snapshot",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    },
                                                    "version": {
                                                        "type": "integer"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                            "state": "active",
                                            "version": 3,
                                            "updated_at": "2026-10-28T09:12:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/folders": {
            "get": {
                "operationId": "instructionsFoldersList",
                "summary": "List folders",
                "description": "Folder tree visible to the acting user with document counts (`count` — directly in the folder, `total` — with subfolders). Readers see only branches that contain readable documents.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_folders_list",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "parent_id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "count": {
                                                        "type": "integer"
                                                    },
                                                    "total": {
                                                        "type": "integer"
                                                    },
                                                    "can_edit": {
                                                        "type": "boolean"
                                                    },
                                                    "restricted": {
                                                        "type": "boolean"
                                                    },
                                                    "children": {
                                                        "type": "array"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 14,
                                            "parent_id": 3,
                                            "name": "Barista",
                                            "icon": "coffee",
                                            "color": null,
                                            "count": 6,
                                            "total": 6,
                                            "can_edit": false,
                                            "restricted": false,
                                            "children": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "instructionsFoldersCreate",
                "summary": "Create a folder",
                "description": "Creates a folder inside `parent_id` (requires edit rights on it) or in the root (knowledge-base managers only).",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_folders_create",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 150
                                    },
                                    "parent_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Parent folder id"
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "parent_id": 42,
                                "icon": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "parent_id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "children": {
                                                    "type": "array"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 14,
                                        "parent_id": 3,
                                        "name": "Barista",
                                        "icon": "coffee",
                                        "color": null,
                                        "count": 6,
                                        "total": 6,
                                        "can_edit": false,
                                        "restricted": false,
                                        "children": []
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/folders/{id}": {
            "patch": {
                "operationId": "instructionsFoldersUpdate",
                "summary": "Update a folder",
                "description": "Rename, change the icon/colour or move the folder (`parent_id`; moving requires edit rights on both the old and the new parent).",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_folders_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Folder id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 150
                                    },
                                    "parent_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "New parent folder id (null — root)"
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 40
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 20
                                    },
                                    "ai_visibility": {
                                        "type": "string",
                                        "enum": [
                                            "inherit",
                                            "none",
                                            "staff",
                                            "client"
                                        ],
                                        "description": "Visibility for the external AI knowledge base (managers of companies with the AI knowledge base only)"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "parent_id": 42,
                                "icon": "string",
                                "color": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "parent_id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "restricted": {
                                                    "type": "boolean"
                                                },
                                                "children": {
                                                    "type": "array"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 14,
                                        "parent_id": 3,
                                        "name": "Barista",
                                        "icon": "coffee",
                                        "color": null,
                                        "count": 6,
                                        "total": 6,
                                        "can_edit": false,
                                        "restricted": false,
                                        "children": []
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "instructionsFoldersDelete",
                "summary": "Delete a folder",
                "description": "Deletes the folder; its subfolders and documents move one level up and keep the folder's permissions.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_folders_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Folder id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/folders/{id}/access": {
            "get": {
                "operationId": "instructionsFoldersAccessGet",
                "summary": "Get folder permissions",
                "description": "Who can view and edit the folder (inherited by its documents and subfolders). Requires edit rights on the folder.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_folders_access_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Folder id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "view": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "edit": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "restricted_by": {
                                                    "type": "array"
                                                },
                                                "inherited_edit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "folder": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "subjects": {
                                                            "type": "array"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "view": [
                                            {
                                                "type": "position",
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            {
                                                "type": "department",
                                                "id": 12,
                                                "name": "Abay Ave"
                                            }
                                        ],
                                        "edit": [
                                            {
                                                "type": "user",
                                                "id": 120,
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "restricted_by": [],
                                        "inherited_edit": {
                                            "folder": null,
                                            "subjects": []
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "instructionsFoldersAccessUpdate",
                "summary": "Set folder permissions",
                "description": "Replaces the view and/or edit lists of the folder. Same subjects and self-protection rules as for documents.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_folders_access_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Folder id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "view": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "department",
                                                        "team"
                                                    ],
                                                    "description": "Subject type"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "description": "User, position, location or team id"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "id"
                                            ]
                                        },
                                        "description": "Who can view. Empty array — everyone who sees the parent folder; omit to keep unchanged",
                                        "maxItems": 500
                                    },
                                    "edit": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "department",
                                                        "team"
                                                    ],
                                                    "description": "Subject type"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "description": "User, position, location or team id"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "id"
                                            ]
                                        },
                                        "description": "Who can edit. Empty array — inherit editors from the folder; omit to keep unchanged",
                                        "maxItems": 500
                                    }
                                }
                            },
                            "example": {
                                "view": [
                                    {
                                        "type": "user",
                                        "id": 42
                                    }
                                ],
                                "edit": [
                                    {
                                        "type": "user",
                                        "id": 42
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "view": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "edit": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "restricted_by": {
                                                    "type": "array"
                                                },
                                                "inherited_edit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "folder": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "subjects": {
                                                            "type": "array"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "view": [
                                            {
                                                "type": "position",
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            {
                                                "type": "department",
                                                "id": 12,
                                                "name": "Abay Ave"
                                            }
                                        ],
                                        "edit": [
                                            {
                                                "type": "user",
                                                "id": 120,
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "restricted_by": [],
                                        "inherited_edit": {
                                            "folder": null,
                                            "subjects": []
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/search": {
            "get": {
                "operationId": "instructionsSearch",
                "summary": "Search instructions",
                "description": "Full-text search over the instructions visible to the acting user (readers — published text; editors — also working titles). Returns up to `limit` matches with a text snippet. Legacy AI-bot keys keep the previous behaviour of this endpoint (see the instructions external API guide).",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_search",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Search query",
                        "schema": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 500
                        }
                    },
                    {
                        "name": "folder_id",
                        "in": "query",
                        "description": "Only documents in this folder and its subfolders",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of results",
                        "schema": {
                            "type": "integer",
                            "default": 20,
                            "minimum": 1,
                            "maximum": 50
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "folder_id": {
                                                        "type": "integer"
                                                    },
                                                    "snippet": {
                                                        "type": "string"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                            "title": "Opening the coffee shop",
                                            "icon": "coffee",
                                            "status": "published",
                                            "folder_id": 14,
                                            "snippet": "…calibrate the grinder before the first espresso…",
                                            "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/tree": {
            "get": {
                "operationId": "instructionsTree",
                "summary": "Get the library tree",
                "description": "The whole library in one call: the folder tree (with document counts and edit rights) and the list of documents visible to the acting user (see `instructions.list` for the item shape).",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_tree",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "folders": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "parent_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": "string"
                                                            },
                                                            "color": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "count": {
                                                                "type": "integer"
                                                            },
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "can_edit": {
                                                                "type": "boolean"
                                                            },
                                                            "restricted": {
                                                                "type": "boolean"
                                                            },
                                                            "children": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "documents": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": "string"
                                                            },
                                                            "summary": {
                                                                "type": "string"
                                                            },
                                                            "folder_id": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "version": {
                                                                "type": "integer"
                                                            },
                                                            "published_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "updated_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "require_ack": {
                                                                "type": "boolean"
                                                            },
                                                            "tags": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "words": {
                                                                "type": "integer"
                                                            },
                                                            "viewed": {
                                                                "type": "boolean"
                                                            },
                                                            "acknowledged": {
                                                                "type": "boolean"
                                                            },
                                                            "needs_ack": {
                                                                "type": "boolean"
                                                            },
                                                            "has_unpublished_changes": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "can_edit": {
                                                                "type": "boolean"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_create_in_root": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "folders": [
                                            {
                                                "id": 14,
                                                "parent_id": 3,
                                                "name": "Barista",
                                                "icon": "coffee",
                                                "color": null,
                                                "count": 6,
                                                "total": 6,
                                                "can_edit": false,
                                                "restricted": false,
                                                "children": []
                                            }
                                        ],
                                        "documents": [
                                            {
                                                "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                                "title": "Opening the coffee shop",
                                                "icon": "coffee",
                                                "summary": "Morning checklist for baristas",
                                                "folder_id": 14,
                                                "status": "published",
                                                "version": 3,
                                                "published_at": "2026-10-28T09:12:00+05:00",
                                                "updated_at": "2026-10-28T09:12:00+05:00",
                                                "require_ack": true,
                                                "tags": [
                                                    "Barista",
                                                    "Opening"
                                                ],
                                                "words": 412,
                                                "viewed": true,
                                                "acknowledged": false,
                                                "needs_ack": true,
                                                "has_unpublished_changes": null,
                                                "can_edit": false,
                                                "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                            }
                                        ],
                                        "can_create_in_root": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}": {
            "get": {
                "operationId": "instructionsGet",
                "summary": "Retrieve an instruction",
                "description": "The current published version of a document (or an older one with `version`) with its content in Markdown (default), HTML or plain text, the table of contents, attachments with download links and the acting user's acknowledgement status. Editors can request the unpublished draft with `draft=true`; a never-published document returns its draft. Pass `track=true` to count the call as a view by the acting user (as when the employee opens it in the app).",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Format of `content`",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "markdown",
                                "html",
                                "text"
                            ],
                            "default": "markdown"
                        }
                    },
                    {
                        "name": "version",
                        "in": "query",
                        "description": "Version number (default — current published version)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "draft",
                        "in": "query",
                        "description": "Return the working draft (editors only)",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "track",
                        "in": "query",
                        "description": "Record a view of the current version by the acting user",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "instructionsUpdate",
                "summary": "Update an instruction",
                "description": "Edits the working draft (`title`, `content`) and document settings. Changes to title or content are saved to the draft and become visible to readers only after `publish`; settings (folder, tags, review period, acknowledgement) apply immediately. Moving to another folder requires edit rights on it.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Title (draft)",
                                        "minLength": 1,
                                        "maxLength": 250
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "New body text, replaces the draft content",
                                        "maxLength": 500000
                                    },
                                    "content_format": {
                                        "type": "string",
                                        "enum": [
                                            "markdown",
                                            "html",
                                            "text"
                                        ],
                                        "description": "Format of `content`, default `markdown`. HTML is sanitised to text formatting, headings, lists, tables, quotes, code and links; add images and files with the upload operation"
                                    },
                                    "folder_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Folder id (null — library root, managers only). Moving requires edit rights on the target folder"
                                    },
                                    "icon": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    },
                                    "summary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Short description shown in the list",
                                        "maxLength": 500
                                    },
                                    "require_ack": {
                                        "type": "boolean",
                                        "description": "Employees must confirm they have read each major version"
                                    },
                                    "review_every_days": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Review period in days (null — no review reminders)",
                                        "minimum": 1,
                                        "maximum": 1095
                                    },
                                    "owner_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Responsible user id"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Tags (replace the current ones)",
                                        "maxItems": 20
                                    },
                                    "ai_visibility": {
                                        "type": "string",
                                        "enum": [
                                            "inherit",
                                            "none",
                                            "staff",
                                            "client"
                                        ],
                                        "description": "Visibility for the external AI knowledge base (only when the AI knowledge base is enabled for the company; managers only)"
                                    },
                                    "ai_note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Hint for the external AI (same conditions as `ai_visibility`)",
                                        "maxLength": 2000
                                    }
                                }
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "content": "string",
                                "content_format": "markdown",
                                "folder_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "instructionsDelete",
                "summary": "Delete an instruction",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/access": {
            "get": {
                "operationId": "instructionsAccessGet",
                "summary": "Get instruction permissions",
                "description": "Who can view and who can edit the document, plus folders above that restrict viewing and the inherited editors. Editors of the document only.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_access_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "view": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "edit": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "restricted_by": {
                                                    "type": "array"
                                                },
                                                "inherited_edit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "folder": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "subjects": {
                                                            "type": "array"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "view": [
                                            {
                                                "type": "position",
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            {
                                                "type": "department",
                                                "id": 12,
                                                "name": "Abay Ave"
                                            }
                                        ],
                                        "edit": [
                                            {
                                                "type": "user",
                                                "id": 120,
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "restricted_by": [],
                                        "inherited_edit": {
                                            "folder": null,
                                            "subjects": []
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "instructionsAccessUpdate",
                "summary": "Set instruction permissions",
                "description": "Replaces the view and/or edit lists of the document. Subjects: `user`, `position`, `department` (location), `team`. If the change would remove the acting user's own edit rights, they are kept as an editor.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_access_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "view": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "department",
                                                        "team"
                                                    ],
                                                    "description": "Subject type"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "description": "User, position, location or team id"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "id"
                                            ]
                                        },
                                        "description": "Who can view. Empty array — everyone who sees the parent folder; omit to keep unchanged",
                                        "maxItems": 500
                                    },
                                    "edit": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "position",
                                                        "department",
                                                        "team"
                                                    ],
                                                    "description": "Subject type"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "description": "User, position, location or team id"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "id"
                                            ]
                                        },
                                        "description": "Who can edit. Empty array — inherit editors from the folder; omit to keep unchanged",
                                        "maxItems": 500
                                    }
                                }
                            },
                            "example": {
                                "view": [
                                    {
                                        "type": "user",
                                        "id": 42
                                    }
                                ],
                                "edit": [
                                    {
                                        "type": "user",
                                        "id": 42
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "view": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "edit": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "restricted_by": {
                                                    "type": "array"
                                                },
                                                "inherited_edit": {
                                                    "type": "object",
                                                    "properties": {
                                                        "folder": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "subjects": {
                                                            "type": "array"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "view": [
                                            {
                                                "type": "position",
                                                "id": 7,
                                                "name": "Barista"
                                            },
                                            {
                                                "type": "department",
                                                "id": 12,
                                                "name": "Abay Ave"
                                            }
                                        ],
                                        "edit": [
                                            {
                                                "type": "user",
                                                "id": 120,
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "restricted_by": [],
                                        "inherited_edit": {
                                            "folder": null,
                                            "subjects": []
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/acknowledge": {
            "post": {
                "operationId": "instructionsAcknowledge",
                "summary": "Acknowledge an instruction",
                "description": "Records that the acting user has read the current version (\"I have read it\"). Required again after each major version when the document has `require_ack`.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_acknowledge",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "acknowledged": true,
                                        "version": 3
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/acknowledgements": {
            "get": {
                "operationId": "instructionsAcknowledgements",
                "summary": "Get the acknowledgement report",
                "description": "Who in the audience of the document has opened and acknowledged the current major version. Editors of the document only.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_acknowledgements",
                "x-plan-feature": "instructions_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "viewed": {
                                                    "type": "integer"
                                                },
                                                "acknowledged": {
                                                    "type": "integer"
                                                },
                                                "ack_rate": {
                                                    "type": "integer"
                                                },
                                                "ack_since_version": {
                                                    "type": "integer"
                                                },
                                                "users": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "position": {
                                                                "type": "string"
                                                            },
                                                            "last_viewed_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "viewed_version": {
                                                                "type": "integer"
                                                            },
                                                            "acknowledged_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "source": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "total": 18,
                                        "viewed": 15,
                                        "acknowledged": 12,
                                        "ack_rate": 67,
                                        "ack_since_version": 3,
                                        "users": [
                                            {
                                                "user": {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                },
                                                "position": "Barista",
                                                "last_viewed_at": "2026-10-29T08:01:00+05:00",
                                                "viewed_version": 3,
                                                "acknowledged_at": "2026-10-29T08:03:00+05:00",
                                                "source": "app"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/archive": {
            "post": {
                "operationId": "instructionsArchive",
                "summary": "Archive or unarchive an instruction",
                "description": "Archived documents are hidden from readers. Pass `archived=false` to return a document from the archive.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_archive",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "archived": {
                                        "type": "boolean",
                                        "description": "Default true"
                                    }
                                }
                            },
                            "example": {
                                "archived": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/diff": {
            "get": {
                "operationId": "instructionsDiff",
                "summary": "Compare versions",
                "description": "Block-level comparison of two versions: `from` (0 — empty document) and `to` (default — current version; editors may pass `draft`). Each block is HTML with `op` = `added`, `removed` or `same`.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_diff",
                "x-plan-feature": "instructions_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "Version number to compare from (0 — empty)",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Version number to compare to, or `draft` (editors only). Default — current version",
                        "schema": {
                            "type": "string",
                            "maxLength": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "from": {
                                                    "type": "integer"
                                                },
                                                "to": {
                                                    "type": "string"
                                                },
                                                "blocks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "op": {
                                                                "type": "string"
                                                            },
                                                            "html": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "added": {
                                                    "type": "integer"
                                                },
                                                "removed": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "from": 2,
                                        "to": "3",
                                        "blocks": [
                                            {
                                                "op": "removed",
                                                "html": "<p>Grind size 12</p>"
                                            },
                                            {
                                                "op": "added",
                                                "html": "<p>Grind size 10</p>"
                                            }
                                        ],
                                        "added": 1,
                                        "removed": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/discard": {
            "post": {
                "operationId": "instructionsDiscard",
                "summary": "Discard draft changes",
                "description": "Resets the draft to the current published version.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_discard",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/duplicate": {
            "post": {
                "operationId": "instructionsDuplicate",
                "summary": "Duplicate an instruction",
                "description": "Creates a draft copy in the same folder with the same settings and permissions.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_duplicate",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/files": {
            "get": {
                "operationId": "instructionsFilesList",
                "summary": "List instruction files",
                "description": "Images and attachments used in the current published version (editors: in the draft with `draft=true`) with download links.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_files_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "draft",
                        "in": "query",
                        "description": "Files of the working draft (editors only)",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "mime": {
                                                        "type": "string"
                                                    },
                                                    "size": {
                                                        "type": "integer"
                                                    },
                                                    "width": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "height": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "kind": "file",
                                            "name": "Cleaning schedule.pdf",
                                            "mime": "application/pdf",
                                            "size": 182044,
                                            "width": null,
                                            "height": null,
                                            "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "instructionsFilesUpload",
                "summary": "Upload a file to an instruction",
                "description": "Uploads an image (JPEG, PNG, WebP, GIF up to 15 MB) or a file (PDF, Office, TXT, CSV, ZIP, MP4, MOV up to 50 MB) and, by default, appends it to the end of the draft as an image or attachment block. Publish to show it to readers.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_files_upload",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "append": {
                                        "type": "boolean",
                                        "description": "Append to the end of the draft, default true"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "content_base64"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "File name with extension"
                                            },
                                            "content_base64": {
                                                "type": "string",
                                                "description": "File content, base64-encoded"
                                            }
                                        }
                                    },
                                    "append": {
                                        "type": "boolean",
                                        "description": "Append to the end of the draft, default true"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "mime": {
                                                    "type": "string"
                                                },
                                                "size": {
                                                    "type": "integer"
                                                },
                                                "width": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "height": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "kind": "file",
                                        "name": "Cleaning schedule.pdf",
                                        "mime": "application/pdf",
                                        "size": 182044,
                                        "width": null,
                                        "height": null,
                                        "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/publish": {
            "post": {
                "operationId": "instructionsPublish",
                "summary": "Publish an instruction",
                "description": "Publishes the draft as a new version. A major version (default) requires a new acknowledgement and notifies employees; a minor one notifies only when `notify=true`.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_publish",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "change_note": {
                                        "type": "string",
                                        "description": "What changed",
                                        "maxLength": 490
                                    },
                                    "is_major": {
                                        "type": "boolean",
                                        "description": "Major version, default true"
                                    },
                                    "notify": {
                                        "type": "boolean",
                                        "description": "Notify employees (default — only for a major version)"
                                    }
                                }
                            },
                            "example": {
                                "change_note": "string",
                                "is_major": true,
                                "notify": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/remind": {
            "post": {
                "operationId": "instructionsRemind",
                "summary": "Remind employees to read an instruction",
                "description": "Sends a push / in-app notification to everyone in the audience who has not acknowledged the current version yet.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_remind",
                "x-plan-feature": "instructions_pro",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "reminded": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "reminded": 6
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/restore": {
            "post": {
                "operationId": "instructionsRestore",
                "summary": "Restore an old version to the draft",
                "description": "Copies an older version into the draft; publish it to make it current again.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_restore",
                "x-plan-feature": "instructions_pro",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "version": {
                                        "type": "integer",
                                        "description": "Version number to restore",
                                        "minimum": 1
                                    }
                                },
                                "required": [
                                    "version"
                                ]
                            },
                            "example": {
                                "version": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/reviewed": {
            "post": {
                "operationId": "instructionsReviewed",
                "summary": "Mark an instruction as reviewed",
                "description": "Confirms the document is still up to date without changes: the next review date moves one period ahead. Only for published documents with a review period.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_reviewed",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "folder": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "folder_path": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "is_latest": {
                                                    "type": "boolean"
                                                },
                                                "is_draft": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "published_by": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "change_note": {
                                                    "type": "string"
                                                },
                                                "is_major": {
                                                    "type": "boolean"
                                                },
                                                "versions_count": {
                                                    "type": "integer"
                                                },
                                                "format": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "string"
                                                },
                                                "toc": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "words": {
                                                    "type": "integer"
                                                },
                                                "read_minutes": {
                                                    "type": "integer"
                                                },
                                                "require_ack": {
                                                    "type": "boolean"
                                                },
                                                "acknowledged": {
                                                    "type": "boolean"
                                                },
                                                "needs_ack": {
                                                    "type": "boolean"
                                                },
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "width": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "height": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "can_edit": {
                                                    "type": "boolean"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "review_every_days": {
                                                    "type": "integer"
                                                },
                                                "review_due_at": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a",
                                        "title": "Opening the coffee shop",
                                        "icon": "coffee",
                                        "summary": "Morning checklist for baristas",
                                        "status": "published",
                                        "folder": {
                                            "id": 14,
                                            "name": "Barista"
                                        },
                                        "folder_path": [
                                            {
                                                "id": 3,
                                                "name": "Operations"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Barista"
                                            }
                                        ],
                                        "tags": [
                                            "Barista",
                                            "Opening"
                                        ],
                                        "version": 3,
                                        "is_latest": true,
                                        "is_draft": false,
                                        "published_at": "2026-10-28T09:12:00+05:00",
                                        "published_by": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "change_note": "New grinder settings",
                                        "is_major": true,
                                        "versions_count": 3,
                                        "format": "markdown",
                                        "content": "## Before opening\n\n1. Turn on the espresso machine\n2. Calibrate the grinder\n\n> **Important:** check fridge temperatures.",
                                        "toc": [
                                            {
                                                "id": "before-opening",
                                                "text": "Before opening",
                                                "level": 2
                                            }
                                        ],
                                        "words": 412,
                                        "read_minutes": 3,
                                        "require_ack": true,
                                        "acknowledged": false,
                                        "needs_ack": true,
                                        "attachments": [
                                            {
                                                "uuid": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                                "kind": "file",
                                                "name": "Cleaning schedule.pdf",
                                                "mime": "application/pdf",
                                                "size": 182044,
                                                "width": null,
                                                "height": null,
                                                "url": "https://files.jecheck.io/instructions/761/2026/11/0c1d2e3f.pdf"
                                            }
                                        ],
                                        "can_edit": true,
                                        "has_unpublished_changes": false,
                                        "review_every_days": 180,
                                        "review_due_at": "2027-04-26",
                                        "owner": {
                                            "id": 120,
                                            "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                            "name": "Daniyar Omarov"
                                        },
                                        "updated_at": "2026-10-28T09:12:00+05:00",
                                        "url": "https://app.jecheck.io/ui/instructions/5d3c2b1a-9f8e-4d7c-8b6a-5f4e3d2c1b0a"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/instructions/{uuid}/versions": {
            "get": {
                "operationId": "instructionsVersions",
                "summary": "List versions of an instruction",
                "description": "Published versions, newest first. Read an older version with `GET /instructions/{uuid}?version=N`.",
                "tags": [
                    "Instructions"
                ],
                "x-mcp-tool": "instructions_versions",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Instruction UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "number": {
                                                        "type": "integer"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "change_note": {
                                                        "type": "string"
                                                    },
                                                    "is_major": {
                                                        "type": "boolean"
                                                    },
                                                    "words": {
                                                        "type": "integer"
                                                    },
                                                    "published_by": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "published_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "is_latest": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "number": 3,
                                            "title": "Opening the coffee shop",
                                            "change_note": "New grinder settings",
                                            "is_major": true,
                                            "words": 412,
                                            "published_by": {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            },
                                            "published_at": "2026-10-28T09:12:00+05:00",
                                            "is_latest": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations": {
            "get": {
                "operationId": "locationsList",
                "summary": "List locations",
                "description": "Locations the token can see, sorted by name. Administrators and holders of `locations.manage` / `locations.staff` see every location; other users see their own locations plus the locations where any of their permissions applies.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "region_id",
                        "in": "query",
                        "description": "Only locations of this region",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search in name and address",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "address": {
                                                        "type": "string"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "timezone": {
                                                        "type": "string"
                                                    },
                                                    "timezone_inherited": {
                                                        "type": "boolean"
                                                    },
                                                    "region": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "managers": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 12,
                                            "name": "Abay Ave",
                                            "address": "Almaty, Abay Ave 52",
                                            "email": "abay@coffeelab.kz",
                                            "timezone": "Asia/Almaty",
                                            "timezone_inherited": true,
                                            "region": {
                                                "id": 3,
                                                "name": "Almaty"
                                            },
                                            "managers": [
                                                {
                                                    "id": 120,
                                                    "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                    "name": "Daniyar Omarov"
                                                }
                                            ],
                                            "created_at": "2024-03-02T09:15:00+05:00",
                                            "url": "https://app.jecheck.io/ui/locations"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "locationsCreate",
                "summary": "Create a location",
                "description": "Adds a location to the company. On the free plan the number of locations is limited — the call fails with `validation_failed` when the limit is reached.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_create",
                "x-permissions": [
                    "locations.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Location name",
                                        "minLength": 2,
                                        "maxLength": 255
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Street address",
                                        "maxLength": 500
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Contact email of the location",
                                        "maxLength": 128
                                    },
                                    "region_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Region id; `null` removes the location from its region"
                                    },
                                    "timezone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "IANA time zone, e.g. `Asia/Almaty`; `null` — same as the company",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "address": "string",
                                "email": "anna@example.com",
                                "region_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "timezone_inherited": {
                                                    "type": "boolean"
                                                },
                                                "region": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "region_managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "teams": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "staff_count": {
                                                    "type": "integer"
                                                },
                                                "on_shift_now": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Abay Ave",
                                        "address": "Almaty, Abay Ave 52",
                                        "email": "abay@coffeelab.kz",
                                        "timezone": "Asia/Almaty",
                                        "timezone_inherited": true,
                                        "region": {
                                            "id": 3,
                                            "name": "Almaty"
                                        },
                                        "managers": [
                                            {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "created_at": "2024-03-02T09:15:00+05:00",
                                        "url": "https://app.jecheck.io/ui/locations",
                                        "region_managers": [
                                            {
                                                "id": 98,
                                                "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                "name": "Asel Nurlanova"
                                            }
                                        ],
                                        "teams": [
                                            {
                                                "id": 4,
                                                "name": "Maintenance"
                                            }
                                        ],
                                        "staff_count": 14,
                                        "on_shift_now": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations/people/{user_id}/anywhere": {
            "put": {
                "operationId": "locationsAnywhereSet",
                "summary": "Allow an employee to work at any location",
                "description": "\"Can work at all locations\": the employee may be scheduled and audit at any location without being attached to it. It does not widen what data the employee sees. Written to the access log.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_anywhere_set",
                "x-permissions": [
                    "locations.staff"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "required": true,
                        "description": "Employee id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "anywhere": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "anywhere"
                                ]
                            },
                            "example": {
                                "anywhere": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "anywhere": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "user": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "anywhere": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations/regions": {
            "get": {
                "operationId": "locationsRegionsList",
                "summary": "List regions",
                "description": "Regions (groups of locations) with their managers. `locations` lists only the locations visible to the token.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_regions_list",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "managers": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "locations": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 3,
                                            "name": "Almaty",
                                            "color": "#2f6fed",
                                            "managers": [
                                                {
                                                    "id": 98,
                                                    "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                    "name": "Asel Nurlanova"
                                                }
                                            ],
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                {
                                                    "id": 14,
                                                    "name": "Dostyk Plaza"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "locationsRegionsCreate",
                "summary": "Create a region",
                "description": "Creates a region. Setting `manager_ids` additionally requires `locations.staff`.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_regions_create",
                "x-permissions": [
                    "locations.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Region name",
                                        "minLength": 1,
                                        "maxLength": 120
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Color, hex like `#2f6fed`",
                                        "maxLength": 9
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Locations of the region",
                                        "maxItems": 1000
                                    },
                                    "manager_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Region managers (user ids); requires `locations.staff`",
                                        "maxItems": 50
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "color": "string",
                                "location_ids": [
                                    12,
                                    14
                                ],
                                "manager_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 3,
                                        "name": "Almaty",
                                        "color": "#2f6fed",
                                        "managers": [
                                            {
                                                "id": 98,
                                                "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                "name": "Asel Nurlanova"
                                            }
                                        ],
                                        "locations": [
                                            {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Dostyk Plaza"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations/regions/{id}": {
            "patch": {
                "operationId": "locationsRegionsUpdate",
                "summary": "Update a region",
                "description": "Partial update. `location_ids` replaces the set of locations in the region; `manager_ids` replaces its managers (requires `locations.staff`).",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_regions_update",
                "x-permissions": [
                    "locations.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Region id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Region name",
                                        "minLength": 1,
                                        "maxLength": 120
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Color, hex like `#2f6fed`",
                                        "maxLength": 9
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Locations of the region",
                                        "maxItems": 1000
                                    },
                                    "manager_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Region managers (user ids); requires `locations.staff`",
                                        "maxItems": 50
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "color": "string",
                                "location_ids": [
                                    12,
                                    14
                                ],
                                "manager_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 3,
                                        "name": "Almaty",
                                        "color": "#2f6fed",
                                        "managers": [
                                            {
                                                "id": 98,
                                                "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                "name": "Asel Nurlanova"
                                            }
                                        ],
                                        "locations": [
                                            {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Dostyk Plaza"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "locationsRegionsDelete",
                "summary": "Delete a region",
                "description": "Deletes the region; its locations stay without a region.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_regions_delete",
                "x-permissions": [
                    "locations.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Region id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations/{id}": {
            "get": {
                "operationId": "locationsGet",
                "summary": "Retrieve a location",
                "description": "Location card: address, time zone, region, managers of the location and of its region, teams serving it. With `locations.manage` or `locations.staff` it also includes the staff count and who is on shift right now.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "timezone_inherited": {
                                                    "type": "boolean"
                                                },
                                                "region": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "region_managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "teams": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "staff_count": {
                                                    "type": "integer"
                                                },
                                                "on_shift_now": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Abay Ave",
                                        "address": "Almaty, Abay Ave 52",
                                        "email": "abay@coffeelab.kz",
                                        "timezone": "Asia/Almaty",
                                        "timezone_inherited": true,
                                        "region": {
                                            "id": 3,
                                            "name": "Almaty"
                                        },
                                        "managers": [
                                            {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "created_at": "2024-03-02T09:15:00+05:00",
                                        "url": "https://app.jecheck.io/ui/locations",
                                        "region_managers": [
                                            {
                                                "id": 98,
                                                "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                "name": "Asel Nurlanova"
                                            }
                                        ],
                                        "teams": [
                                            {
                                                "id": 4,
                                                "name": "Maintenance"
                                            }
                                        ],
                                        "staff_count": 14,
                                        "on_shift_now": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "locationsUpdate",
                "summary": "Update a location",
                "description": "Partial update: send only the fields to change.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_update",
                "x-permissions": [
                    "locations.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Location name",
                                        "minLength": 2,
                                        "maxLength": 255
                                    },
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Street address",
                                        "maxLength": 500
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Contact email of the location",
                                        "maxLength": 128
                                    },
                                    "region_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Region id; `null` removes the location from its region"
                                    },
                                    "timezone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "IANA time zone, e.g. `Asia/Almaty`; `null` — same as the company",
                                        "maxLength": 64
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "address": "string",
                                "email": "anna@example.com",
                                "region_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "timezone_inherited": {
                                                    "type": "boolean"
                                                },
                                                "region": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "region_managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "teams": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "staff_count": {
                                                    "type": "integer"
                                                },
                                                "on_shift_now": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Abay Ave",
                                        "address": "Almaty, Abay Ave 52",
                                        "email": "abay@coffeelab.kz",
                                        "timezone": "Asia/Almaty",
                                        "timezone_inherited": true,
                                        "region": {
                                            "id": 3,
                                            "name": "Almaty"
                                        },
                                        "managers": [
                                            {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "created_at": "2024-03-02T09:15:00+05:00",
                                        "url": "https://app.jecheck.io/ui/locations",
                                        "region_managers": [
                                            {
                                                "id": 98,
                                                "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                "name": "Asel Nurlanova"
                                            }
                                        ],
                                        "teams": [
                                            {
                                                "id": 4,
                                                "name": "Maintenance"
                                            }
                                        ],
                                        "staff_count": 14,
                                        "on_shift_now": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "locationsDelete",
                "summary": "Delete a location",
                "description": "Marks the location as deleted. Its history (audits, tasks) stays; it disappears from lists and filters.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_delete",
                "x-permissions": [
                    "locations.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations/{id}/managers": {
            "put": {
                "operationId": "locationsManagersSet",
                "summary": "Set location managers",
                "description": "Replaces the list of managers of the location. Managers get the permissions of the system role \"Location manager\" for this location. The change is written to the access log.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_managers_set",
                "x-permissions": [
                    "locations.staff"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Employee ids; empty array removes all managers",
                                        "maxItems": 50
                                    }
                                },
                                "required": [
                                    "user_ids"
                                ]
                            },
                            "example": {
                                "user_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "timezone_inherited": {
                                                    "type": "boolean"
                                                },
                                                "region": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "region_managers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "teams": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "staff_count": {
                                                    "type": "integer"
                                                },
                                                "on_shift_now": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "name": "Abay Ave",
                                        "address": "Almaty, Abay Ave 52",
                                        "email": "abay@coffeelab.kz",
                                        "timezone": "Asia/Almaty",
                                        "timezone_inherited": true,
                                        "region": {
                                            "id": 3,
                                            "name": "Almaty"
                                        },
                                        "managers": [
                                            {
                                                "id": 120,
                                                "uuid": "7a6b5c4d-3e2f-4a1b-9c8d-7e6f5a4b3c2d",
                                                "name": "Daniyar Omarov"
                                            }
                                        ],
                                        "created_at": "2024-03-02T09:15:00+05:00",
                                        "url": "https://app.jecheck.io/ui/locations",
                                        "region_managers": [
                                            {
                                                "id": 98,
                                                "uuid": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
                                                "name": "Asel Nurlanova"
                                            }
                                        ],
                                        "teams": [
                                            {
                                                "id": 4,
                                                "name": "Maintenance"
                                            }
                                        ],
                                        "staff_count": 14,
                                        "on_shift_now": [
                                            {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/locations/{id}/staff": {
            "get": {
                "operationId": "locationsStaffList",
                "summary": "List location staff",
                "description": "Employees attached to the location: `kind` is `home` (primary location) or `extra` (also works here); managers that are not attached have `kind: null`. `on_shift_now` — a published shift is running or the employee has clocked in.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_staff_list",
                "x-permissions": [
                    "locations.manage",
                    "locations.staff"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "is_manager": {
                                                        "type": "boolean"
                                                    },
                                                    "position": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "on_shift_now": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "user": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "kind": "home",
                                            "is_manager": false,
                                            "position": {
                                                "id": 5,
                                                "name": "Barista"
                                            },
                                            "on_shift_now": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "locationsStaffSet",
                "summary": "Attach or detach employees",
                "description": "`kind: home` makes the location the primary one for these employees (their previous primary location becomes additional); `kind: extra` adds it as an additional location; `kind: null` removes them from the location (the manager flag is kept). Returns the updated staff list.",
                "tags": [
                    "Locations"
                ],
                "x-mcp-tool": "locations_staff_set",
                "x-permissions": [
                    "locations.staff"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Location id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Employee ids",
                                        "minItems": 1,
                                        "maxItems": 200
                                    },
                                    "kind": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "home",
                                            "extra"
                                        ],
                                        "description": "`home`, `extra` or `null` to detach"
                                    }
                                },
                                "required": [
                                    "user_ids",
                                    "kind"
                                ]
                            },
                            "example": {
                                "user_ids": [
                                    12,
                                    14
                                ],
                                "kind": "home"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "is_manager": {
                                                        "type": "boolean"
                                                    },
                                                    "position": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "on_shift_now": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "user": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "kind": "home",
                                            "is_manager": false,
                                            "position": {
                                                "id": 5,
                                                "name": "Barista"
                                            },
                                            "on_shift_now": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me": {
            "get": {
                "operationId": "accountMe",
                "summary": "Get the current identity",
                "description": "Returns the user the token acts as (for a company key — its service user), the company, the token kind and scopes, and the list of permissions with the locations where each one applies (`null` — all locations).",
                "tags": [
                    "Account"
                ],
                "x-mcp-tool": "account_me",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "is_admin": {
                                                            "type": "boolean"
                                                        },
                                                        "is_service": {
                                                            "type": "boolean"
                                                        },
                                                        "locale": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "company": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "country": {
                                                            "type": "string"
                                                        },
                                                        "locale": {
                                                            "type": "string"
                                                        },
                                                        "timezone": {
                                                            "type": "string"
                                                        },
                                                        "plan": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "token": {
                                                    "type": "object",
                                                    "properties": {
                                                        "kind": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "prefix": {
                                                            "type": "string"
                                                        },
                                                        "scopes": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "analytics.view": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "audits.view": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "tasks.view_all": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "user": {
                                            "id": 1042,
                                            "uuid": "9b7c3f8e-2d1a-4b6e-9f00-1c2d3e4f5a6b",
                                            "name": "API: Data warehouse",
                                            "email": "api-7f3k@api.jecheck.io",
                                            "is_admin": false,
                                            "is_service": true,
                                            "locale": "en"
                                        },
                                        "company": {
                                            "id": 761,
                                            "name": "Coffee Lab",
                                            "country": "KZ",
                                            "locale": "ru",
                                            "timezone": "Asia/Almaty",
                                            "plan": "enterprise"
                                        },
                                        "token": {
                                            "kind": "key",
                                            "name": "Data warehouse",
                                            "prefix": "jck_live_a1B2c3",
                                            "scopes": [
                                                "read",
                                                "write"
                                            ],
                                            "expires_at": null
                                        },
                                        "permissions": {
                                            "analytics.view": null,
                                            "audits.view": [
                                                12,
                                                14
                                            ],
                                            "tasks.view_all": null
                                        },
                                        "locations": [
                                            {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Dostyk Plaza"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me/dispatcher/questions": {
            "get": {
                "operationId": "dispatcherMeQuestions",
                "summary": "List my open dispatcher questions",
                "description": "Questions the dispatcher is waiting for the acting user to answer (the same as in Telegram and its mini app): stuck or overdue tasks, audit findings to accept, fixes to confirm, HACCP alerts, overdue planned audits, due date approvals. `text` is the question in HTML (Telegram subset); `buttons` are the possible answers — pass `action` and `arg` of a button to the answer operation. `input` tells what else is accepted: `text` (free answer), `date`, `reason`, `who` (free text) or `photo`.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_questions",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "duty": {
                                                                "type": "string"
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            },
                                                            "open": {
                                                                "type": "boolean"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "awaiting": {
                                                                "type": "string"
                                                            },
                                                            "input": {
                                                                "type": "string"
                                                            },
                                                            "photo": {
                                                                "type": "boolean"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "buttons": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "text": {
                                                                                "type": "string"
                                                                            },
                                                                            "action": {
                                                                                "type": "string"
                                                                            },
                                                                            "arg": {
                                                                                "type": [
                                                                                    "string",
                                                                                    "null"
                                                                                ]
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "asked_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "task": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "key": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    },
                                                                    "location": {
                                                                        "type": "string"
                                                                    },
                                                                    "due": {
                                                                        "type": "string"
                                                                    },
                                                                    "overdue": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "needs_photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "data": [
                                            {
                                                "id": 512,
                                                "duty": "task_flow",
                                                "role": "executor",
                                                "open": true,
                                                "state": "open",
                                                "awaiting": "answer",
                                                "input": "text",
                                                "photo": true,
                                                "text": "The task is overdue by 3 days.\n<b>Replace the shower seal</b> · Downtown club · due 01.11\n\nWhat is its status?",
                                                "buttons": [
                                                    [
                                                        {
                                                            "text": "✅ Done",
                                                            "action": "done",
                                                            "arg": null
                                                        },
                                                        {
                                                            "text": "🕒 Need time",
                                                            "action": "time",
                                                            "arg": null
                                                        }
                                                    ],
                                                    [
                                                        {
                                                            "text": "⛔ Blocked",
                                                            "action": "blocked",
                                                            "arg": null
                                                        },
                                                        {
                                                            "text": "↩️ Not mine",
                                                            "action": "not_mine",
                                                            "arg": null
                                                        }
                                                    ]
                                                ],
                                                "asked_at": "2026-11-04T11:02:00+05:00",
                                                "task": {
                                                    "id": 88231,
                                                    "key": "6f1c2a9e-3b7d-4c11-9a52-0d8e7f6b1a23",
                                                    "title": "Replace the shower seal",
                                                    "status": "in_progress",
                                                    "location": "Downtown club",
                                                    "due": "01.11.2026",
                                                    "overdue": true,
                                                    "needs_photo": true
                                                }
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me/dispatcher/questions/{id}": {
            "get": {
                "operationId": "dispatcherMeQuestionsGet",
                "summary": "Get my dispatcher question",
                "description": "One question with task details: description, photos (links valid for 2 hours), last comments, the audit it came from.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_questions_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Question (conversation) id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "duty": {
                                                    "type": "string"
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "open": {
                                                    "type": "boolean"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "awaiting": {
                                                    "type": "string"
                                                },
                                                "input": {
                                                    "type": "string"
                                                },
                                                "photo": {
                                                    "type": "boolean"
                                                },
                                                "text": {
                                                    "type": "string"
                                                },
                                                "buttons": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "text": {
                                                                    "type": "string"
                                                                },
                                                                "action": {
                                                                    "type": "string"
                                                                },
                                                                "arg": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "asked_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "key": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "overdue": {
                                                            "type": "boolean"
                                                        },
                                                        "needs_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 512,
                                        "duty": "task_flow",
                                        "role": "executor",
                                        "open": true,
                                        "state": "open",
                                        "awaiting": "answer",
                                        "input": "text",
                                        "photo": true,
                                        "text": "The task is overdue by 3 days.\n<b>Replace the shower seal</b> · Downtown club · due 01.11\n\nWhat is its status?",
                                        "buttons": [
                                            [
                                                {
                                                    "text": "✅ Done",
                                                    "action": "done",
                                                    "arg": null
                                                },
                                                {
                                                    "text": "🕒 Need time",
                                                    "action": "time",
                                                    "arg": null
                                                }
                                            ],
                                            [
                                                {
                                                    "text": "⛔ Blocked",
                                                    "action": "blocked",
                                                    "arg": null
                                                },
                                                {
                                                    "text": "↩️ Not mine",
                                                    "action": "not_mine",
                                                    "arg": null
                                                }
                                            ]
                                        ],
                                        "asked_at": "2026-11-04T11:02:00+05:00",
                                        "task": {
                                            "id": 88231,
                                            "key": "6f1c2a9e-3b7d-4c11-9a52-0d8e7f6b1a23",
                                            "title": "Replace the shower seal",
                                            "status": "in_progress",
                                            "location": "Downtown club",
                                            "due": "01.11.2026",
                                            "overdue": true,
                                            "needs_photo": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me/dispatcher/questions/{id}/answer": {
            "post": {
                "operationId": "dispatcherMeQuestionsAnswer",
                "summary": "Answer my dispatcher question",
                "description": "Answers as the acting user, exactly like a button, a short message or a photo in Telegram: the dispatcher applies it in jeCheck (completes the task, moves the due date within the company norm or asks the manager, records the reason, attaches the after photo). Pass one of: `action` (+ `arg`) from the question buttons, `text`, or `photo`. Returns the dispatcher replies and the question state after the answer (`open: false` — nothing more is needed).",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_questions_answer",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Question (conversation) id",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "photo",
                        "in": "query",
                        "description": "Photo (after photo for a task, photo for a request)",
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "description": "Button action, e.g. `done`, `time`, `date`, `blocked`, `not_mine`, `accept`, `return`, `approve`, `deny`",
                                        "maxLength": 32
                                    },
                                    "arg": {
                                        "type": "string",
                                        "description": "Button argument, e.g. a date `2026-11-11` for `date`",
                                        "maxLength": 40
                                    },
                                    "text": {
                                        "type": "string",
                                        "description": "Free-text answer (a reason, a new date in words, a comment)",
                                        "maxLength": 2000
                                    }
                                }
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "description": "Button action, e.g. `done`, `time`, `date`, `blocked`, `not_mine`, `accept`, `return`, `approve`, `deny`",
                                        "maxLength": 32
                                    },
                                    "arg": {
                                        "type": "string",
                                        "description": "Button argument, e.g. a date `2026-11-11` for `date`",
                                        "maxLength": 40
                                    },
                                    "text": {
                                        "type": "string",
                                        "description": "Free-text answer (a reason, a new date in words, a comment)",
                                        "maxLength": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "replies": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "html": {
                                                                "type": "string"
                                                            },
                                                            "buttons": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "question": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "duty": {
                                                            "type": "string"
                                                        },
                                                        "role": {
                                                            "type": "string"
                                                        },
                                                        "open": {
                                                            "type": "boolean"
                                                        },
                                                        "state": {
                                                            "type": "string"
                                                        },
                                                        "awaiting": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "input": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "photo": {
                                                            "type": "boolean"
                                                        },
                                                        "text": {
                                                            "type": "string"
                                                        },
                                                        "buttons": {
                                                            "type": "array"
                                                        },
                                                        "asked_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "task": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                },
                                                                "status": {
                                                                    "type": "string"
                                                                },
                                                                "location": {
                                                                    "type": "string"
                                                                },
                                                                "due": {
                                                                    "type": "string"
                                                                },
                                                                "overdue": {
                                                                    "type": "boolean"
                                                                },
                                                                "needs_photo": {
                                                                    "type": "boolean"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "replies": [
                                            {
                                                "html": "Moved the due date to 11.11. I will write if the task is not closed by then.",
                                                "buttons": []
                                            }
                                        ],
                                        "question": {
                                            "id": 512,
                                            "duty": "task_flow",
                                            "role": "executor",
                                            "open": false,
                                            "state": "waiting",
                                            "awaiting": null,
                                            "input": null,
                                            "photo": true,
                                            "text": "The task is overdue by 3 days.\n<b>Replace the shower seal</b> · Downtown club · due 01.11\n\nWhat is its status?",
                                            "buttons": [],
                                            "asked_at": "2026-11-04T11:02:00+05:00",
                                            "task": {
                                                "id": 88231,
                                                "key": "6f1c2a9e-3b7d-4c11-9a52-0d8e7f6b1a23",
                                                "title": "Replace the shower seal",
                                                "status": "in_progress",
                                                "location": "Downtown club",
                                                "due": "01.11.2026",
                                                "overdue": true,
                                                "needs_photo": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me/dispatcher/requests": {
            "post": {
                "operationId": "dispatcherMeRequestsCreate",
                "summary": "Send a request to the dispatcher",
                "description": "What broke or what is needed, in free words (as a message to the bot). The dispatcher works out the location and the department and asks to confirm: the reply contains the question with the confirmation buttons — answer it with the answer operation. Needs the dispatcher and its «Requests» duty to be on.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_requests_create",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "photo",
                        "in": "query",
                        "description": "Photo of the problem",
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "description": "What happened or what is needed",
                                        "minLength": 3,
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "text"
                                ]
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "description": "What happened or what is needed",
                                        "minLength": 3,
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "text"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "replies": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "html": {
                                                                "type": "string"
                                                            },
                                                            "buttons": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "text": {
                                                                                "type": "string"
                                                                            },
                                                                            "action": {
                                                                                "type": "string"
                                                                            },
                                                                            "arg": {
                                                                                "type": [
                                                                                    "string",
                                                                                    "null"
                                                                                ]
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "question": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "duty": {
                                                            "type": "string"
                                                        },
                                                        "role": {
                                                            "type": "string"
                                                        },
                                                        "open": {
                                                            "type": "boolean"
                                                        },
                                                        "state": {
                                                            "type": "string"
                                                        },
                                                        "awaiting": {
                                                            "type": "string"
                                                        },
                                                        "input": {
                                                            "type": "string"
                                                        },
                                                        "photo": {
                                                            "type": "boolean"
                                                        },
                                                        "text": {
                                                            "type": "string"
                                                        },
                                                        "buttons": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "text": {
                                                                            "type": "string"
                                                                        },
                                                                        "action": {
                                                                            "type": "string"
                                                                        },
                                                                        "arg": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "asked_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "task": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "replies": [
                                            {
                                                "html": "Request: <b>Shower tap is leaking</b> · Downtown club → Maintenance. Create?",
                                                "buttons": [
                                                    [
                                                        {
                                                            "text": "Create",
                                                            "action": "create",
                                                            "arg": null
                                                        },
                                                        {
                                                            "text": "Cancel",
                                                            "action": "cancel",
                                                            "arg": null
                                                        }
                                                    ]
                                                ]
                                            }
                                        ],
                                        "question": {
                                            "id": 640,
                                            "duty": "intake",
                                            "role": "executor",
                                            "open": true,
                                            "state": "open",
                                            "awaiting": "answer",
                                            "input": "text",
                                            "photo": true,
                                            "text": "The task is overdue by 3 days.\n<b>Replace the shower seal</b> · Downtown club · due 01.11\n\nWhat is its status?",
                                            "buttons": [
                                                [
                                                    {
                                                        "text": "✅ Done",
                                                        "action": "done",
                                                        "arg": null
                                                    },
                                                    {
                                                        "text": "🕒 Need time",
                                                        "action": "time",
                                                        "arg": null
                                                    }
                                                ],
                                                [
                                                    {
                                                        "text": "⛔ Blocked",
                                                        "action": "blocked",
                                                        "arg": null
                                                    },
                                                    {
                                                        "text": "↩️ Not mine",
                                                        "action": "not_mine",
                                                        "arg": null
                                                    }
                                                ]
                                            ],
                                            "asked_at": "2026-11-04T11:02:00+05:00",
                                            "task": null
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me/telegram": {
            "get": {
                "operationId": "dispatcherMeTelegram",
                "summary": "Get my Telegram connection",
                "description": "Whether the acting user receives dispatcher messages in Telegram.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_telegram",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "available": {
                                                    "type": "boolean"
                                                },
                                                "linked": {
                                                    "type": "boolean"
                                                },
                                                "username": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "available": true,
                                        "linked": true,
                                        "username": "aliya_s"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "dispatcherMeTelegramUnlink",
                "summary": "Disconnect my Telegram",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_telegram_unlink",
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "disconnected": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "disconnected": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/me/telegram/link": {
            "post": {
                "operationId": "dispatcherMeTelegramLink",
                "summary": "Get my Telegram connection link",
                "description": "A one-time link that connects the acting user to the dispatcher bot.",
                "tags": [
                    "AI dispatcher"
                ],
                "x-mcp-tool": "dispatcher_me_telegram_link",
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "url": "https://t.me/jecheck_bot?start=Qm3x8YtK2pZr7Lw0Vn5aBcDe"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/locations": {
            "get": {
                "operationId": "mysteryLocations",
                "summary": "Get mystery shopper scores by location",
                "description": "Accepted visits per location: count, average and last scores, trend of the last 8 visits.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_locations",
                "x-permissions": [
                    "mystery.view"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Submitted from",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Submitted to",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "visits": {
                                                        "type": "integer"
                                                    },
                                                    "avg": {
                                                        "type": "number"
                                                    },
                                                    "last": {
                                                        "type": "number"
                                                    },
                                                    "prev": {
                                                        "type": "integer"
                                                    },
                                                    "last_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "trend": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "visits": 6,
                                            "avg": 84.2,
                                            "last": 87.5,
                                            "prev": 80,
                                            "last_at": "2026-11-03T13:40:00+05:00",
                                            "trend": [
                                                78,
                                                80,
                                                87.5
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/media/{id}": {
            "get": {
                "operationId": "mysteryMediaGet",
                "summary": "Download a private visit file",
                "description": "Audio / video recorded by the guest (REST only, not available as an MCP tool).",
                "tags": [
                    "Mystery shopper"
                ],
                "x-permissions": [
                    "mystery.view"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "File id from `files` of the visit",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "file": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "file": "binary"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders": {
            "get": {
                "operationId": "mysteryOrdersList",
                "summary": "List turnkey orders",
                "description": "Orders for mystery shopper checks performed by jeCheck guests, with progress of their visits. No plan feature is needed — the service is paid per order.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_list",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "business_type": {
                                                        "type": "string"
                                                    },
                                                    "scenarios": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "goal": {
                                                        "type": "string"
                                                    },
                                                    "checklist_id": {
                                                        "type": "integer"
                                                    },
                                                    "needs_questionnaire": {
                                                        "type": "boolean"
                                                    },
                                                    "questionnaire_brief": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "visits_per_location": {
                                                        "type": "integer"
                                                    },
                                                    "period_from": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "period_to": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "time_slots": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "requirements": {
                                                        "type": "object",
                                                        "properties": {
                                                            "audio": {
                                                                "type": "boolean"
                                                            },
                                                            "receipt": {
                                                                "type": "boolean"
                                                            },
                                                            "place_photos": {
                                                                "type": "boolean"
                                                            },
                                                            "staff": {
                                                                "type": "boolean"
                                                            },
                                                            "express": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    },
                                                    "shopper_profile": {
                                                        "type": "object",
                                                        "properties": {
                                                            "gender": {
                                                                "type": "string"
                                                            },
                                                            "age_from": {
                                                                "type": "integer"
                                                            },
                                                            "age_to": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "legend": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "reimbursement": {
                                                        "type": "integer"
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "quote": {
                                                        "type": "object",
                                                        "properties": {
                                                            "currency": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "lines": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "qty": {
                                                                            "type": "integer"
                                                                        },
                                                                        "unit": {
                                                                            "type": "integer"
                                                                        },
                                                                        "amount": {
                                                                            "type": "integer"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "per_visit": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "offer": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "total": {
                                                        "type": "integer"
                                                    },
                                                    "contact_name": {
                                                        "type": "string"
                                                    },
                                                    "contact_phone": {
                                                        "type": "string"
                                                    },
                                                    "comment": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "payment_status": {
                                                        "type": "string"
                                                    },
                                                    "decline_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "locations": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "department_id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "city": {
                                                                    "type": "string"
                                                                },
                                                                "address": {
                                                                    "type": "string"
                                                                },
                                                                "visits": {
                                                                    "type": "integer"
                                                                },
                                                                "note": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "problems": {
                                                        "type": "object"
                                                    },
                                                    "progress": {
                                                        "type": "object",
                                                        "properties": {
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "avg": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "planned": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "submitted_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "confirmed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "launched_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "completed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                            "number": "MS-00042",
                                            "status": "quoted",
                                            "business_type": "cafe",
                                            "scenarios": [
                                                "service",
                                                "cleanliness"
                                            ],
                                            "goal": "Check the new menu launch",
                                            "checklist_id": 310,
                                            "needs_questionnaire": false,
                                            "questionnaire_brief": null,
                                            "visits_per_location": 2,
                                            "period_from": "2026-11-10",
                                            "period_to": "2026-11-30",
                                            "time_slots": [
                                                "weekday",
                                                "evening"
                                            ],
                                            "requirements": {
                                                "audio": false,
                                                "receipt": true,
                                                "place_photos": false,
                                                "staff": true,
                                                "express": false
                                            },
                                            "shopper_profile": {
                                                "gender": "any",
                                                "age_from": 20,
                                                "age_to": 35
                                            },
                                            "legend": null,
                                            "reimbursement": 5000,
                                            "currency": "KZT",
                                            "quote": {
                                                "currency": "KZT",
                                                "visits": 6,
                                                "lines": [
                                                    {
                                                        "key": "visit",
                                                        "qty": 6,
                                                        "unit": 9000,
                                                        "amount": 54000
                                                    }
                                                ],
                                                "total": 84000,
                                                "per_visit": 14000
                                            },
                                            "offer": null,
                                            "total": 84000,
                                            "contact_name": "Daniyar Omarov",
                                            "contact_phone": "+7 701 000 00 01",
                                            "comment": null,
                                            "payment_status": "none",
                                            "decline_reason": null,
                                            "locations": [
                                                {
                                                    "id": 77,
                                                    "department_id": 12,
                                                    "name": "Abay Ave",
                                                    "city": "Almaty",
                                                    "address": "12 Abay Ave",
                                                    "visits": 2,
                                                    "note": null
                                                }
                                            ],
                                            "problems": {},
                                            "progress": {
                                                "done": 0,
                                                "avg": null,
                                                "planned": 6
                                            },
                                            "submitted_at": "2026-11-03T10:00:00+05:00",
                                            "confirmed_at": null,
                                            "launched_at": null,
                                            "completed_at": null,
                                            "created_at": "2026-11-02T18:00:00+05:00",
                                            "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "mysteryOrdersCreate",
                "summary": "Create a turnkey order draft",
                "description": "Saves a draft with a quote; `problems` lists what is missing before `submit`. The service is currently available only in some countries (see the catalog).",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_create",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "business_type": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "restaurant",
                                            "cafe",
                                            "bar",
                                            "coffee",
                                            "fastfood",
                                            "retail",
                                            "beauty",
                                            "clinic",
                                            "hotel",
                                            "other"
                                        ],
                                        "description": "Business type (affects price and reimbursement)"
                                    },
                                    "scenarios": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "What the guest checks: dine_in, takeaway, delivery, phone, consultation",
                                        "maxItems": 5
                                    },
                                    "goal": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "checklist_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Questionnaire (checklist) to use"
                                    },
                                    "needs_questionnaire": {
                                        "type": "boolean",
                                        "description": "Ask jeCheck to prepare the questionnaire"
                                    },
                                    "questionnaire_brief": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "visits_per_location": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 1,
                                        "maximum": 50
                                    },
                                    "period_from": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "period_to": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "time_slots": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "weekday, weekend, morning, lunch, evening",
                                        "maxItems": 5
                                    },
                                    "requirements": {
                                        "type": "object",
                                        "properties": {
                                            "audio": {
                                                "type": "boolean"
                                            },
                                            "receipt": {
                                                "type": "boolean"
                                            },
                                            "place_photos": {
                                                "type": "boolean"
                                            },
                                            "staff": {
                                                "type": "boolean"
                                            },
                                            "express": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "shopper_profile": {
                                        "type": "object",
                                        "properties": {
                                            "gender": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "enum": [
                                                    "any",
                                                    "f",
                                                    "m"
                                                ]
                                            },
                                            "age_from": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 16,
                                                "maximum": 80
                                            },
                                            "age_to": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 16,
                                                "maximum": 80
                                            },
                                            "note": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 500
                                            }
                                        }
                                    },
                                    "legend": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "reimbursement": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "description": "Receipt reimbursement per visit",
                                        "minimum": 0
                                    },
                                    "locations": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "department_id": {
                                                    "type": "integer",
                                                    "description": "Location id"
                                                },
                                                "city": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 120
                                                },
                                                "address": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 500
                                                },
                                                "visits": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1,
                                                    "maximum": 50
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 1000
                                                }
                                            },
                                            "required": [
                                                "department_id"
                                            ]
                                        },
                                        "maxItems": 300
                                    },
                                    "contact_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "contact_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    }
                                }
                            },
                            "example": {
                                "business_type": "restaurant",
                                "scenarios": [
                                    "example"
                                ],
                                "goal": "string",
                                "checklist_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "business_type": {
                                                    "type": "string"
                                                },
                                                "scenarios": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "goal": {
                                                    "type": "string"
                                                },
                                                "checklist_id": {
                                                    "type": "integer"
                                                },
                                                "needs_questionnaire": {
                                                    "type": "boolean"
                                                },
                                                "questionnaire_brief": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "visits_per_location": {
                                                    "type": "integer"
                                                },
                                                "period_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "period_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "requirements": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audio": {
                                                            "type": "boolean"
                                                        },
                                                        "receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "staff": {
                                                            "type": "boolean"
                                                        },
                                                        "express": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "shopper_profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "age_from": {
                                                            "type": "integer"
                                                        },
                                                        "age_to": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "legend": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reimbursement": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "quote": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "visits": {
                                                            "type": "integer"
                                                        },
                                                        "lines": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "qty": {
                                                                        "type": "integer"
                                                                    },
                                                                    "unit": {
                                                                        "type": "integer"
                                                                    },
                                                                    "amount": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "per_visit": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "offer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                },
                                                "contact_phone": {
                                                    "type": "string"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payment_status": {
                                                    "type": "string"
                                                },
                                                "decline_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "department_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "city": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "object"
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "confirmed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "launched_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "number": "MS-00042",
                                        "status": "quoted",
                                        "business_type": "cafe",
                                        "scenarios": [
                                            "service",
                                            "cleanliness"
                                        ],
                                        "goal": "Check the new menu launch",
                                        "checklist_id": 310,
                                        "needs_questionnaire": false,
                                        "questionnaire_brief": null,
                                        "visits_per_location": 2,
                                        "period_from": "2026-11-10",
                                        "period_to": "2026-11-30",
                                        "time_slots": [
                                            "weekday",
                                            "evening"
                                        ],
                                        "requirements": {
                                            "audio": false,
                                            "receipt": true,
                                            "place_photos": false,
                                            "staff": true,
                                            "express": false
                                        },
                                        "shopper_profile": {
                                            "gender": "any",
                                            "age_from": 20,
                                            "age_to": 35
                                        },
                                        "legend": null,
                                        "reimbursement": 5000,
                                        "currency": "KZT",
                                        "quote": {
                                            "currency": "KZT",
                                            "visits": 6,
                                            "lines": [
                                                {
                                                    "key": "visit",
                                                    "qty": 6,
                                                    "unit": 9000,
                                                    "amount": 54000
                                                }
                                            ],
                                            "total": 84000,
                                            "per_visit": 14000
                                        },
                                        "offer": null,
                                        "total": 84000,
                                        "contact_name": "Daniyar Omarov",
                                        "contact_phone": "+7 701 000 00 01",
                                        "comment": null,
                                        "payment_status": "none",
                                        "decline_reason": null,
                                        "locations": [
                                            {
                                                "id": 77,
                                                "department_id": 12,
                                                "name": "Abay Ave",
                                                "city": "Almaty",
                                                "address": "12 Abay Ave",
                                                "visits": 2,
                                                "note": null
                                            }
                                        ],
                                        "problems": {},
                                        "progress": {
                                            "done": 0,
                                            "avg": null,
                                            "planned": 6
                                        },
                                        "submitted_at": "2026-11-03T10:00:00+05:00",
                                        "confirmed_at": null,
                                        "launched_at": null,
                                        "completed_at": null,
                                        "created_at": "2026-11-02T18:00:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/catalog": {
            "get": {
                "operationId": "mysteryOrdersCatalog",
                "summary": "Get turnkey pricing catalog",
                "description": "Whether the service is available in the company's country, business types, cities and prices used by the quote.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_catalog",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "availability": {
                                                    "type": "object",
                                                    "properties": {
                                                        "available": {
                                                            "type": "boolean"
                                                        },
                                                        "country": {
                                                            "type": "string"
                                                        },
                                                        "countries": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "catalog": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "cities": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "major_cities": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "business_types": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "reimbursement": {
                                                                        "type": "integer"
                                                                    },
                                                                    "tier": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "availability": {
                                            "available": true,
                                            "country": "KZ",
                                            "countries": [
                                                "KZ"
                                            ]
                                        },
                                        "catalog": {
                                            "currency": "KZT",
                                            "cities": [
                                                "Almaty"
                                            ],
                                            "major_cities": [
                                                "Almaty"
                                            ],
                                            "business_types": [
                                                {
                                                    "key": "cafe",
                                                    "reimbursement": 5000,
                                                    "tier": "standard"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/quote": {
            "post": {
                "operationId": "mysteryOrdersQuote",
                "summary": "Calculate a turnkey quote",
                "description": "Price estimate for the given order parameters without saving anything.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_quote",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "business_type": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "restaurant",
                                            "cafe",
                                            "bar",
                                            "coffee",
                                            "fastfood",
                                            "retail",
                                            "beauty",
                                            "clinic",
                                            "hotel",
                                            "other"
                                        ],
                                        "description": "Business type (affects price and reimbursement)"
                                    },
                                    "scenarios": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "What the guest checks: dine_in, takeaway, delivery, phone, consultation",
                                        "maxItems": 5
                                    },
                                    "goal": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "checklist_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Questionnaire (checklist) to use"
                                    },
                                    "needs_questionnaire": {
                                        "type": "boolean",
                                        "description": "Ask jeCheck to prepare the questionnaire"
                                    },
                                    "questionnaire_brief": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "visits_per_location": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 1,
                                        "maximum": 50
                                    },
                                    "period_from": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "period_to": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "time_slots": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "weekday, weekend, morning, lunch, evening",
                                        "maxItems": 5
                                    },
                                    "requirements": {
                                        "type": "object",
                                        "properties": {
                                            "audio": {
                                                "type": "boolean"
                                            },
                                            "receipt": {
                                                "type": "boolean"
                                            },
                                            "place_photos": {
                                                "type": "boolean"
                                            },
                                            "staff": {
                                                "type": "boolean"
                                            },
                                            "express": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "shopper_profile": {
                                        "type": "object",
                                        "properties": {
                                            "gender": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "enum": [
                                                    "any",
                                                    "f",
                                                    "m"
                                                ]
                                            },
                                            "age_from": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 16,
                                                "maximum": 80
                                            },
                                            "age_to": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 16,
                                                "maximum": 80
                                            },
                                            "note": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 500
                                            }
                                        }
                                    },
                                    "legend": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "reimbursement": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "description": "Receipt reimbursement per visit",
                                        "minimum": 0
                                    },
                                    "locations": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "department_id": {
                                                    "type": "integer",
                                                    "description": "Location id"
                                                },
                                                "city": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 120
                                                },
                                                "address": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 500
                                                },
                                                "visits": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1,
                                                    "maximum": 50
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 1000
                                                }
                                            },
                                            "required": [
                                                "department_id"
                                            ]
                                        },
                                        "maxItems": 300
                                    },
                                    "contact_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "contact_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    }
                                }
                            },
                            "example": {
                                "business_type": "restaurant",
                                "scenarios": [
                                    "example"
                                ],
                                "goal": "string",
                                "checklist_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "visits": {
                                                    "type": "integer"
                                                },
                                                "lines": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "qty": {
                                                                "type": "integer"
                                                            },
                                                            "unit": {
                                                                "type": "integer"
                                                            },
                                                            "amount": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "per_visit": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "currency": "KZT",
                                        "visits": 6,
                                        "lines": [
                                            {
                                                "key": "visit",
                                                "qty": 6,
                                                "unit": 9000,
                                                "amount": 54000
                                            }
                                        ],
                                        "total": 84000,
                                        "per_visit": 14000
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/{uuid}": {
            "get": {
                "operationId": "mysteryOrdersGet",
                "summary": "Retrieve a turnkey order",
                "description": "Order terms, quote and offer, progress, visits (results after jeCheck approves them) and the message history.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_get",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "business_type": {
                                                    "type": "string"
                                                },
                                                "scenarios": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "goal": {
                                                    "type": "string"
                                                },
                                                "checklist_id": {
                                                    "type": "integer"
                                                },
                                                "needs_questionnaire": {
                                                    "type": "boolean"
                                                },
                                                "questionnaire_brief": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "visits_per_location": {
                                                    "type": "integer"
                                                },
                                                "period_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "period_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "requirements": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audio": {
                                                            "type": "boolean"
                                                        },
                                                        "receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "staff": {
                                                            "type": "boolean"
                                                        },
                                                        "express": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "shopper_profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "age_from": {
                                                            "type": "integer"
                                                        },
                                                        "age_to": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "legend": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reimbursement": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "quote": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "visits": {
                                                            "type": "integer"
                                                        },
                                                        "lines": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "qty": {
                                                                        "type": "integer"
                                                                    },
                                                                    "unit": {
                                                                        "type": "integer"
                                                                    },
                                                                    "amount": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "per_visit": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "offer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                },
                                                "contact_phone": {
                                                    "type": "string"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payment_status": {
                                                    "type": "string"
                                                },
                                                "decline_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "department_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "city": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "object"
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "confirmed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "launched_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "visits": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "stage": {
                                                                "type": "string"
                                                            },
                                                            "window_to": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "visited_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            },
                                                            "audit_uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "side": {
                                                                "type": "string"
                                                            },
                                                            "author": {
                                                                "type": "string"
                                                            },
                                                            "body": {
                                                                "type": "string"
                                                            },
                                                            "payload": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "number": "MS-00042",
                                        "status": "quoted",
                                        "business_type": "cafe",
                                        "scenarios": [
                                            "service",
                                            "cleanliness"
                                        ],
                                        "goal": "Check the new menu launch",
                                        "checklist_id": 310,
                                        "needs_questionnaire": false,
                                        "questionnaire_brief": null,
                                        "visits_per_location": 2,
                                        "period_from": "2026-11-10",
                                        "period_to": "2026-11-30",
                                        "time_slots": [
                                            "weekday",
                                            "evening"
                                        ],
                                        "requirements": {
                                            "audio": false,
                                            "receipt": true,
                                            "place_photos": false,
                                            "staff": true,
                                            "express": false
                                        },
                                        "shopper_profile": {
                                            "gender": "any",
                                            "age_from": 20,
                                            "age_to": 35
                                        },
                                        "legend": null,
                                        "reimbursement": 5000,
                                        "currency": "KZT",
                                        "quote": {
                                            "currency": "KZT",
                                            "visits": 6,
                                            "lines": [
                                                {
                                                    "key": "visit",
                                                    "qty": 6,
                                                    "unit": 9000,
                                                    "amount": 54000
                                                }
                                            ],
                                            "total": 84000,
                                            "per_visit": 14000
                                        },
                                        "offer": null,
                                        "total": 84000,
                                        "contact_name": "Daniyar Omarov",
                                        "contact_phone": "+7 701 000 00 01",
                                        "comment": null,
                                        "payment_status": "none",
                                        "decline_reason": null,
                                        "locations": [
                                            {
                                                "id": 77,
                                                "department_id": 12,
                                                "name": "Abay Ave",
                                                "city": "Almaty",
                                                "address": "12 Abay Ave",
                                                "visits": 2,
                                                "note": null
                                            }
                                        ],
                                        "problems": {},
                                        "progress": {
                                            "done": 0,
                                            "avg": null,
                                            "planned": 6
                                        },
                                        "submitted_at": "2026-11-03T10:00:00+05:00",
                                        "confirmed_at": null,
                                        "launched_at": null,
                                        "completed_at": null,
                                        "created_at": "2026-11-02T18:00:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "visits": [
                                            {
                                                "id": 2050,
                                                "location": {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                "stage": "done",
                                                "window_to": "2026-11-20T21:00:00+05:00",
                                                "visited_at": "2026-11-18T19:10:00+05:00",
                                                "score": 91,
                                                "audit_uuid": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e"
                                            }
                                        ],
                                        "events": [
                                            {
                                                "id": 1,
                                                "type": "message",
                                                "side": "service",
                                                "author": "Anna",
                                                "body": "We have prepared the terms",
                                                "payload": null,
                                                "at": "2026-11-03T11:00:00+05:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "mysteryOrdersUpdate",
                "summary": "Update a turnkey order draft",
                "description": "Only drafts can be edited; after submitting, changes are agreed with the manager in messages.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_update",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "business_type": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "restaurant",
                                            "cafe",
                                            "bar",
                                            "coffee",
                                            "fastfood",
                                            "retail",
                                            "beauty",
                                            "clinic",
                                            "hotel",
                                            "other"
                                        ],
                                        "description": "Business type (affects price and reimbursement)"
                                    },
                                    "scenarios": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "What the guest checks: dine_in, takeaway, delivery, phone, consultation",
                                        "maxItems": 5
                                    },
                                    "goal": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "checklist_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Questionnaire (checklist) to use"
                                    },
                                    "needs_questionnaire": {
                                        "type": "boolean",
                                        "description": "Ask jeCheck to prepare the questionnaire"
                                    },
                                    "questionnaire_brief": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "visits_per_location": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 1,
                                        "maximum": 50
                                    },
                                    "period_from": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "period_to": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date"
                                    },
                                    "time_slots": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "weekday, weekend, morning, lunch, evening",
                                        "maxItems": 5
                                    },
                                    "requirements": {
                                        "type": "object",
                                        "properties": {
                                            "audio": {
                                                "type": "boolean"
                                            },
                                            "receipt": {
                                                "type": "boolean"
                                            },
                                            "place_photos": {
                                                "type": "boolean"
                                            },
                                            "staff": {
                                                "type": "boolean"
                                            },
                                            "express": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "shopper_profile": {
                                        "type": "object",
                                        "properties": {
                                            "gender": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "enum": [
                                                    "any",
                                                    "f",
                                                    "m"
                                                ]
                                            },
                                            "age_from": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 16,
                                                "maximum": 80
                                            },
                                            "age_to": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 16,
                                                "maximum": 80
                                            },
                                            "note": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 500
                                            }
                                        }
                                    },
                                    "legend": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    },
                                    "reimbursement": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "description": "Receipt reimbursement per visit",
                                        "minimum": 0
                                    },
                                    "locations": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "department_id": {
                                                    "type": "integer",
                                                    "description": "Location id"
                                                },
                                                "city": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 120
                                                },
                                                "address": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 500
                                                },
                                                "visits": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1,
                                                    "maximum": 50
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 1000
                                                }
                                            },
                                            "required": [
                                                "department_id"
                                            ]
                                        },
                                        "maxItems": 300
                                    },
                                    "contact_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "contact_phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 3000
                                    }
                                }
                            },
                            "example": {
                                "business_type": "restaurant",
                                "scenarios": [
                                    "example"
                                ],
                                "goal": "string",
                                "checklist_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "business_type": {
                                                    "type": "string"
                                                },
                                                "scenarios": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "goal": {
                                                    "type": "string"
                                                },
                                                "checklist_id": {
                                                    "type": "integer"
                                                },
                                                "needs_questionnaire": {
                                                    "type": "boolean"
                                                },
                                                "questionnaire_brief": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "visits_per_location": {
                                                    "type": "integer"
                                                },
                                                "period_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "period_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "requirements": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audio": {
                                                            "type": "boolean"
                                                        },
                                                        "receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "staff": {
                                                            "type": "boolean"
                                                        },
                                                        "express": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "shopper_profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "age_from": {
                                                            "type": "integer"
                                                        },
                                                        "age_to": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "legend": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reimbursement": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "quote": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "visits": {
                                                            "type": "integer"
                                                        },
                                                        "lines": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "qty": {
                                                                        "type": "integer"
                                                                    },
                                                                    "unit": {
                                                                        "type": "integer"
                                                                    },
                                                                    "amount": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "per_visit": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "offer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                },
                                                "contact_phone": {
                                                    "type": "string"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payment_status": {
                                                    "type": "string"
                                                },
                                                "decline_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "department_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "city": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "object"
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "confirmed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "launched_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "number": "MS-00042",
                                        "status": "quoted",
                                        "business_type": "cafe",
                                        "scenarios": [
                                            "service",
                                            "cleanliness"
                                        ],
                                        "goal": "Check the new menu launch",
                                        "checklist_id": 310,
                                        "needs_questionnaire": false,
                                        "questionnaire_brief": null,
                                        "visits_per_location": 2,
                                        "period_from": "2026-11-10",
                                        "period_to": "2026-11-30",
                                        "time_slots": [
                                            "weekday",
                                            "evening"
                                        ],
                                        "requirements": {
                                            "audio": false,
                                            "receipt": true,
                                            "place_photos": false,
                                            "staff": true,
                                            "express": false
                                        },
                                        "shopper_profile": {
                                            "gender": "any",
                                            "age_from": 20,
                                            "age_to": 35
                                        },
                                        "legend": null,
                                        "reimbursement": 5000,
                                        "currency": "KZT",
                                        "quote": {
                                            "currency": "KZT",
                                            "visits": 6,
                                            "lines": [
                                                {
                                                    "key": "visit",
                                                    "qty": 6,
                                                    "unit": 9000,
                                                    "amount": 54000
                                                }
                                            ],
                                            "total": 84000,
                                            "per_visit": 14000
                                        },
                                        "offer": null,
                                        "total": 84000,
                                        "contact_name": "Daniyar Omarov",
                                        "contact_phone": "+7 701 000 00 01",
                                        "comment": null,
                                        "payment_status": "none",
                                        "decline_reason": null,
                                        "locations": [
                                            {
                                                "id": 77,
                                                "department_id": 12,
                                                "name": "Abay Ave",
                                                "city": "Almaty",
                                                "address": "12 Abay Ave",
                                                "visits": 2,
                                                "note": null
                                            }
                                        ],
                                        "problems": {},
                                        "progress": {
                                            "done": 0,
                                            "avg": null,
                                            "planned": 6
                                        },
                                        "submitted_at": "2026-11-03T10:00:00+05:00",
                                        "confirmed_at": null,
                                        "launched_at": null,
                                        "completed_at": null,
                                        "created_at": "2026-11-02T18:00:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "mysteryOrdersDelete",
                "summary": "Delete a turnkey order draft",
                "description": "Only drafts can be deleted; submitted orders are cancelled.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_delete",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/{uuid}/accept": {
            "post": {
                "operationId": "mysteryOrdersAccept",
                "summary": "Accept the offer of a turnkey order",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_accept",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "business_type": {
                                                    "type": "string"
                                                },
                                                "scenarios": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "goal": {
                                                    "type": "string"
                                                },
                                                "checklist_id": {
                                                    "type": "integer"
                                                },
                                                "needs_questionnaire": {
                                                    "type": "boolean"
                                                },
                                                "questionnaire_brief": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "visits_per_location": {
                                                    "type": "integer"
                                                },
                                                "period_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "period_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "requirements": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audio": {
                                                            "type": "boolean"
                                                        },
                                                        "receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "staff": {
                                                            "type": "boolean"
                                                        },
                                                        "express": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "shopper_profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "age_from": {
                                                            "type": "integer"
                                                        },
                                                        "age_to": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "legend": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reimbursement": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "quote": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "visits": {
                                                            "type": "integer"
                                                        },
                                                        "lines": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "qty": {
                                                                        "type": "integer"
                                                                    },
                                                                    "unit": {
                                                                        "type": "integer"
                                                                    },
                                                                    "amount": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "per_visit": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "offer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                },
                                                "contact_phone": {
                                                    "type": "string"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payment_status": {
                                                    "type": "string"
                                                },
                                                "decline_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "department_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "city": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "object"
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "confirmed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "launched_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "number": "MS-00042",
                                        "status": "quoted",
                                        "business_type": "cafe",
                                        "scenarios": [
                                            "service",
                                            "cleanliness"
                                        ],
                                        "goal": "Check the new menu launch",
                                        "checklist_id": 310,
                                        "needs_questionnaire": false,
                                        "questionnaire_brief": null,
                                        "visits_per_location": 2,
                                        "period_from": "2026-11-10",
                                        "period_to": "2026-11-30",
                                        "time_slots": [
                                            "weekday",
                                            "evening"
                                        ],
                                        "requirements": {
                                            "audio": false,
                                            "receipt": true,
                                            "place_photos": false,
                                            "staff": true,
                                            "express": false
                                        },
                                        "shopper_profile": {
                                            "gender": "any",
                                            "age_from": 20,
                                            "age_to": 35
                                        },
                                        "legend": null,
                                        "reimbursement": 5000,
                                        "currency": "KZT",
                                        "quote": {
                                            "currency": "KZT",
                                            "visits": 6,
                                            "lines": [
                                                {
                                                    "key": "visit",
                                                    "qty": 6,
                                                    "unit": 9000,
                                                    "amount": 54000
                                                }
                                            ],
                                            "total": 84000,
                                            "per_visit": 14000
                                        },
                                        "offer": null,
                                        "total": 84000,
                                        "contact_name": "Daniyar Omarov",
                                        "contact_phone": "+7 701 000 00 01",
                                        "comment": null,
                                        "payment_status": "none",
                                        "decline_reason": null,
                                        "locations": [
                                            {
                                                "id": 77,
                                                "department_id": 12,
                                                "name": "Abay Ave",
                                                "city": "Almaty",
                                                "address": "12 Abay Ave",
                                                "visits": 2,
                                                "note": null
                                            }
                                        ],
                                        "problems": {},
                                        "progress": {
                                            "done": 0,
                                            "avg": null,
                                            "planned": 6
                                        },
                                        "submitted_at": "2026-11-03T10:00:00+05:00",
                                        "confirmed_at": null,
                                        "launched_at": null,
                                        "completed_at": null,
                                        "created_at": "2026-11-02T18:00:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/{uuid}/cancel": {
            "post": {
                "operationId": "mysteryOrdersCancel",
                "summary": "Cancel a turnkey order",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_cancel",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    }
                                }
                            },
                            "example": {
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "business_type": {
                                                    "type": "string"
                                                },
                                                "scenarios": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "goal": {
                                                    "type": "string"
                                                },
                                                "checklist_id": {
                                                    "type": "integer"
                                                },
                                                "needs_questionnaire": {
                                                    "type": "boolean"
                                                },
                                                "questionnaire_brief": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "visits_per_location": {
                                                    "type": "integer"
                                                },
                                                "period_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "period_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "requirements": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audio": {
                                                            "type": "boolean"
                                                        },
                                                        "receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "staff": {
                                                            "type": "boolean"
                                                        },
                                                        "express": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "shopper_profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "age_from": {
                                                            "type": "integer"
                                                        },
                                                        "age_to": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "legend": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reimbursement": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "quote": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "visits": {
                                                            "type": "integer"
                                                        },
                                                        "lines": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "qty": {
                                                                        "type": "integer"
                                                                    },
                                                                    "unit": {
                                                                        "type": "integer"
                                                                    },
                                                                    "amount": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "per_visit": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "offer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                },
                                                "contact_phone": {
                                                    "type": "string"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payment_status": {
                                                    "type": "string"
                                                },
                                                "decline_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "department_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "city": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "object"
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "confirmed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "launched_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "number": "MS-00042",
                                        "status": "quoted",
                                        "business_type": "cafe",
                                        "scenarios": [
                                            "service",
                                            "cleanliness"
                                        ],
                                        "goal": "Check the new menu launch",
                                        "checklist_id": 310,
                                        "needs_questionnaire": false,
                                        "questionnaire_brief": null,
                                        "visits_per_location": 2,
                                        "period_from": "2026-11-10",
                                        "period_to": "2026-11-30",
                                        "time_slots": [
                                            "weekday",
                                            "evening"
                                        ],
                                        "requirements": {
                                            "audio": false,
                                            "receipt": true,
                                            "place_photos": false,
                                            "staff": true,
                                            "express": false
                                        },
                                        "shopper_profile": {
                                            "gender": "any",
                                            "age_from": 20,
                                            "age_to": 35
                                        },
                                        "legend": null,
                                        "reimbursement": 5000,
                                        "currency": "KZT",
                                        "quote": {
                                            "currency": "KZT",
                                            "visits": 6,
                                            "lines": [
                                                {
                                                    "key": "visit",
                                                    "qty": 6,
                                                    "unit": 9000,
                                                    "amount": 54000
                                                }
                                            ],
                                            "total": 84000,
                                            "per_visit": 14000
                                        },
                                        "offer": null,
                                        "total": 84000,
                                        "contact_name": "Daniyar Omarov",
                                        "contact_phone": "+7 701 000 00 01",
                                        "comment": null,
                                        "payment_status": "none",
                                        "decline_reason": null,
                                        "locations": [
                                            {
                                                "id": 77,
                                                "department_id": 12,
                                                "name": "Abay Ave",
                                                "city": "Almaty",
                                                "address": "12 Abay Ave",
                                                "visits": 2,
                                                "note": null
                                            }
                                        ],
                                        "problems": {},
                                        "progress": {
                                            "done": 0,
                                            "avg": null,
                                            "planned": 6
                                        },
                                        "submitted_at": "2026-11-03T10:00:00+05:00",
                                        "confirmed_at": null,
                                        "launched_at": null,
                                        "completed_at": null,
                                        "created_at": "2026-11-02T18:00:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/{uuid}/messages": {
            "post": {
                "operationId": "mysteryOrdersMessagesCreate",
                "summary": "Write to the jeCheck manager",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_messages_create",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "body": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 5000
                                    }
                                },
                                "required": [
                                    "body"
                                ]
                            },
                            "example": {
                                "body": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "side": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "string"
                                                },
                                                "body": {
                                                    "type": "string"
                                                },
                                                "payload": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2,
                                        "type": "message",
                                        "side": "client",
                                        "author": "Daniyar Omarov",
                                        "body": "Can we add one more location?",
                                        "payload": null,
                                        "at": "2026-11-03T12:00:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/orders/{uuid}/submit": {
            "post": {
                "operationId": "mysteryOrdersSubmit",
                "summary": "Submit a turnkey order",
                "description": "Sends the completed draft to jeCheck managers, who reply with an offer.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_orders_submit",
                "x-permissions": [
                    "mystery.orders"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Order UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "business_type": {
                                                    "type": "string"
                                                },
                                                "scenarios": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "goal": {
                                                    "type": "string"
                                                },
                                                "checklist_id": {
                                                    "type": "integer"
                                                },
                                                "needs_questionnaire": {
                                                    "type": "boolean"
                                                },
                                                "questionnaire_brief": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "visits_per_location": {
                                                    "type": "integer"
                                                },
                                                "period_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "period_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "requirements": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audio": {
                                                            "type": "boolean"
                                                        },
                                                        "receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "staff": {
                                                            "type": "boolean"
                                                        },
                                                        "express": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "shopper_profile": {
                                                    "type": "object",
                                                    "properties": {
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "age_from": {
                                                            "type": "integer"
                                                        },
                                                        "age_to": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "legend": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reimbursement": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "quote": {
                                                    "type": "object",
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "visits": {
                                                            "type": "integer"
                                                        },
                                                        "lines": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "qty": {
                                                                        "type": "integer"
                                                                    },
                                                                    "unit": {
                                                                        "type": "integer"
                                                                    },
                                                                    "amount": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "per_visit": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "offer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                },
                                                "contact_phone": {
                                                    "type": "string"
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payment_status": {
                                                    "type": "string"
                                                },
                                                "decline_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "department_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "city": {
                                                                "type": "string"
                                                            },
                                                            "address": {
                                                                "type": "string"
                                                            },
                                                            "visits": {
                                                                "type": "integer"
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "problems": {
                                                    "type": "object"
                                                },
                                                "progress": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "avg": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "planned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "confirmed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "launched_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                                        "number": "MS-00042",
                                        "status": "quoted",
                                        "business_type": "cafe",
                                        "scenarios": [
                                            "service",
                                            "cleanliness"
                                        ],
                                        "goal": "Check the new menu launch",
                                        "checklist_id": 310,
                                        "needs_questionnaire": false,
                                        "questionnaire_brief": null,
                                        "visits_per_location": 2,
                                        "period_from": "2026-11-10",
                                        "period_to": "2026-11-30",
                                        "time_slots": [
                                            "weekday",
                                            "evening"
                                        ],
                                        "requirements": {
                                            "audio": false,
                                            "receipt": true,
                                            "place_photos": false,
                                            "staff": true,
                                            "express": false
                                        },
                                        "shopper_profile": {
                                            "gender": "any",
                                            "age_from": 20,
                                            "age_to": 35
                                        },
                                        "legend": null,
                                        "reimbursement": 5000,
                                        "currency": "KZT",
                                        "quote": {
                                            "currency": "KZT",
                                            "visits": 6,
                                            "lines": [
                                                {
                                                    "key": "visit",
                                                    "qty": 6,
                                                    "unit": 9000,
                                                    "amount": 54000
                                                }
                                            ],
                                            "total": 84000,
                                            "per_visit": 14000
                                        },
                                        "offer": null,
                                        "total": 84000,
                                        "contact_name": "Daniyar Omarov",
                                        "contact_phone": "+7 701 000 00 01",
                                        "comment": null,
                                        "payment_status": "none",
                                        "decline_reason": null,
                                        "locations": [
                                            {
                                                "id": 77,
                                                "department_id": 12,
                                                "name": "Abay Ave",
                                                "city": "Almaty",
                                                "address": "12 Abay Ave",
                                                "visits": 2,
                                                "note": null
                                            }
                                        ],
                                        "problems": {},
                                        "progress": {
                                            "done": 0,
                                            "avg": null,
                                            "planned": 6
                                        },
                                        "submitted_at": "2026-11-03T10:00:00+05:00",
                                        "confirmed_at": null,
                                        "launched_at": null,
                                        "completed_at": null,
                                        "created_at": "2026-11-02T18:00:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/orders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/shoppers": {
            "get": {
                "operationId": "mysteryShoppersList",
                "summary": "List guests",
                "description": "The company's pool of mystery guests with visit statistics. Email and phone — only with `mystery.payouts` (logged).",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_shoppers_list",
                "x-permissions": [
                    "mystery.view"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "active",
                        "in": "query",
                        "description": "Only active guests",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "city": {
                                                        "type": "string"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "phone": {
                                                        "type": "string"
                                                    },
                                                    "has_email": {
                                                        "type": "boolean"
                                                    },
                                                    "note": {
                                                        "type": "string"
                                                    },
                                                    "is_active": {
                                                        "type": "boolean"
                                                    },
                                                    "visits": {
                                                        "type": "object",
                                                        "properties": {
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "approved": {
                                                                "type": "integer"
                                                            },
                                                            "rejected": {
                                                                "type": "integer"
                                                            },
                                                            "active": {
                                                                "type": "integer"
                                                            },
                                                            "returned": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "last_visit_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 55,
                                            "name": "Madina K.",
                                            "city": "Almaty",
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00",
                                            "has_email": true,
                                            "note": "Prefers weekends",
                                            "is_active": true,
                                            "visits": {
                                                "total": 12,
                                                "approved": 10,
                                                "rejected": 1,
                                                "active": 1,
                                                "returned": 2
                                            },
                                            "last_visit_at": "2026-11-03T13:40:00+05:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "mysteryShoppersCreate",
                "summary": "Add a guest",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_shoppers_create",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "minLength": 2,
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "city": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "is_active": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "email": "anna@example.com",
                                "phone": "+77010000000",
                                "city": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "city": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": "string"
                                                },
                                                "has_email": {
                                                    "type": "boolean"
                                                },
                                                "note": {
                                                    "type": "string"
                                                },
                                                "is_active": {
                                                    "type": "boolean"
                                                },
                                                "visits": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "approved": {
                                                            "type": "integer"
                                                        },
                                                        "rejected": {
                                                            "type": "integer"
                                                        },
                                                        "active": {
                                                            "type": "integer"
                                                        },
                                                        "returned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "last_visit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 55,
                                        "name": "Madina K.",
                                        "city": "Almaty",
                                        "email": "madina@example.com",
                                        "phone": "+7 701 000 00 00",
                                        "has_email": true,
                                        "note": "Prefers weekends",
                                        "is_active": true,
                                        "visits": {
                                            "total": 12,
                                            "approved": 10,
                                            "rejected": 1,
                                            "active": 1,
                                            "returned": 2
                                        },
                                        "last_visit_at": "2026-11-03T13:40:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/shoppers/{id}": {
            "patch": {
                "operationId": "mysteryShoppersUpdate",
                "summary": "Update a guest",
                "description": "Contacts (email, phone) can be changed only with `mystery.payouts`.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_shoppers_update",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Guest id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "minLength": 2,
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "city": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "is_active": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "email": "anna@example.com",
                                "phone": "+77010000000",
                                "city": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "city": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": "string"
                                                },
                                                "has_email": {
                                                    "type": "boolean"
                                                },
                                                "note": {
                                                    "type": "string"
                                                },
                                                "is_active": {
                                                    "type": "boolean"
                                                },
                                                "visits": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "approved": {
                                                            "type": "integer"
                                                        },
                                                        "rejected": {
                                                            "type": "integer"
                                                        },
                                                        "active": {
                                                            "type": "integer"
                                                        },
                                                        "returned": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "last_visit_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 55,
                                        "name": "Madina K.",
                                        "city": "Almaty",
                                        "email": "madina@example.com",
                                        "phone": "+7 701 000 00 00",
                                        "has_email": true,
                                        "note": "Prefers weekends",
                                        "is_active": true,
                                        "visits": {
                                            "total": 12,
                                            "approved": 10,
                                            "rejected": 1,
                                            "active": 1,
                                            "returned": 2
                                        },
                                        "last_visit_at": "2026-11-03T13:40:00+05:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "mysteryShoppersDelete",
                "summary": "Delete a guest",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_shoppers_delete",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Guest id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits": {
            "get": {
                "operationId": "mysteryVisitsList",
                "summary": "List mystery shopper visits",
                "description": "Visits of the company, newest first. The guest link (`guest_url`) is returned with `mystery.manage`; payouts — with `mystery.payouts` (logged). Turnkey visits (`managed`) hide the guest.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_list",
                "x-permissions": [
                    "mystery.view"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "status[]",
                        "in": "query",
                        "description": "scheduled, opened, in_progress, submitted, returned, approved, rejected, cancelled, expired",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_id",
                        "in": "query",
                        "description": "Only this questionnaire",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "shopper_id",
                        "in": "query",
                        "description": "Only this guest",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "wave",
                        "in": "query",
                        "description": "Only this wave",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    },
                    {
                        "name": "managed",
                        "in": "query",
                        "description": "`true` — only turnkey visits, `false` — only own visits",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "flagged",
                        "in": "query",
                        "description": "Only submitted visits with serious fraud flags",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Submitted from",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Submitted to",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only visits changed after this moment — use for incremental sync",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "managed": {
                                                        "type": "boolean"
                                                    },
                                                    "order_uuid": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "checklist": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "shopper": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "wave": {
                                                        "type": "string"
                                                    },
                                                    "window_from": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "window_to": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "score": {
                                                        "type": "number"
                                                    },
                                                    "level": {
                                                        "type": "string"
                                                    },
                                                    "submitted_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "guest_url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "audit_uuid": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "payout_status": {
                                                        "type": "string"
                                                    },
                                                    "payout_amount": {
                                                        "type": "integer"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 2041,
                                            "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                            "status": "submitted",
                                            "managed": false,
                                            "order_uuid": null,
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "checklist": {
                                                "id": 310,
                                                "name": "Guest experience"
                                            },
                                            "shopper": {
                                                "id": 55,
                                                "name": "Madina K."
                                            },
                                            "wave": "November",
                                            "window_from": "2026-11-01T09:00:00+05:00",
                                            "window_to": "2026-11-07T21:00:00+05:00",
                                            "score": 87.5,
                                            "level": "warning",
                                            "submitted_at": "2026-11-03T13:40:00+05:00",
                                            "created_at": "2026-10-30T10:00:00+05:00",
                                            "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                            "audit_uuid": null,
                                            "payout_status": "pending",
                                            "payout_amount": 4500,
                                            "updated_at": "2026-11-03T13:40:00+05:00",
                                            "url": "https://app.jecheck.io/ui/mystery/visits/2041"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "mysteryVisitsCreate",
                "summary": "Create visits",
                "description": "Creates one visit per location for a questionnaire (checklist). Each visit gets a personal guest link (`guest_url`) that works without the app; with `shopper_id` and `send_email` the guest receives it by email.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_create",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "checklist_id": {
                                        "type": "integer",
                                        "description": "Questionnaire (checklist)"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1,
                                        "maxItems": 300
                                    },
                                    "shopper_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Guest from the pool"
                                    },
                                    "wave": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120
                                    },
                                    "brief": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Task for the guest",
                                        "maxLength": 5000
                                    },
                                    "legend": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Cover story",
                                        "maxLength": 5000
                                    },
                                    "window_from": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "window_to": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time",
                                        "description": "Deadline (after `window_from`)"
                                    },
                                    "send_email": {
                                        "type": "boolean",
                                        "description": "Email the link to the guest"
                                    },
                                    "settings": {
                                        "type": "object",
                                        "properties": {
                                            "require_receipt": {
                                                "type": "boolean"
                                            },
                                            "require_geo": {
                                                "type": "boolean"
                                            },
                                            "require_timing": {
                                                "type": "boolean"
                                            },
                                            "require_staff": {
                                                "type": "boolean"
                                            },
                                            "require_audio": {
                                                "type": "boolean"
                                            },
                                            "require_place_photos": {
                                                "type": "boolean"
                                            },
                                            "review_required": {
                                                "type": "boolean",
                                                "description": "false — accept automatically"
                                            },
                                            "min_minutes": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 0,
                                                "maximum": 600
                                            },
                                            "geo_radius": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 50,
                                                "maximum": 5000
                                            },
                                            "receipt_limit": {
                                                "type": [
                                                    "number",
                                                    "null"
                                                ],
                                                "minimum": 0
                                            },
                                            "currency": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 8
                                            }
                                        },
                                        "description": "Questionnaire requirements and anti-fraud checks"
                                    }
                                },
                                "required": [
                                    "checklist_id",
                                    "location_ids"
                                ]
                            },
                            "example": {
                                "checklist_id": 42,
                                "location_ids": [
                                    12,
                                    14
                                ],
                                "shopper_id": 42,
                                "wave": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "guest_url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "invited": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 2041,
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                            "invited": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}": {
            "get": {
                "operationId": "mysteryVisitsGet",
                "summary": "Retrieve a visit",
                "description": "Full questionnaire: answers with per-question results, timing, guest report, geolocation vs the location, fraud flags, AI check, files (receipt, photos, audio — private media via `mystery.media.get`), history. Turnkey visits are available after jeCheck approves them (`409 managed_visit` before).",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_get",
                "x-permissions": [
                    "mystery.view"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "mysteryVisitsUpdate",
                "summary": "Update a visit",
                "description": "Change the brief, cover story, time window or guest of an open visit. The guest cannot be changed after the visit has started.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_update",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "brief": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "legend": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "window_from": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "window_to": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "shopper_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                }
                            },
                            "example": {
                                "brief": "string",
                                "legend": "string",
                                "window_from": "2026-11-03T09:00:00+05:00",
                                "window_to": "2026-11-03T09:00:00+05:00"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "mysteryVisitsDelete",
                "summary": "Delete a visit",
                "description": "An accepted visit has become an audit — delete the audit first.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_delete",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/ai-review": {
            "post": {
                "operationId": "mysteryVisitsAiReview",
                "summary": "Run the AI review of a visit",
                "description": "Transcribes audio and asks the AI to check the questionnaire for consistency (requires the AI feature for the company). The result is in `ai_check` of the visit.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_ai_review",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/approve": {
            "post": {
                "operationId": "mysteryVisitsApprove",
                "summary": "Accept a visit",
                "description": "Accepts a submitted questionnaire: a regular audit is created from it (reports, mailings, corrective tasks follow as for any audit). Returns the visit with `audit_uuid`.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_approve",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Comment",
                                        "maxLength": 3000
                                    }
                                }
                            },
                            "example": {
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/cancel": {
            "post": {
                "operationId": "mysteryVisitsCancel",
                "summary": "Cancel a visit",
                "description": "Cancels a visit that has not been submitted; the guest link stops working.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_cancel",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/invite": {
            "post": {
                "operationId": "mysteryVisitsInvite",
                "summary": "Send the link to the guest",
                "description": "Emails the questionnaire link to the guest of the visit (requires a guest with an email).",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_invite",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/payout": {
            "post": {
                "operationId": "mysteryVisitsPayout",
                "summary": "Set the payout of a visit",
                "description": "Payout status and amount for the guest (receipt reimbursement and fee). Requires `mystery.payouts`. `pending` and `paid` are accepted only for an approved visit (422 otherwise); `none` is always allowed.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_payout",
                "x-permissions": [
                    "mystery.payouts"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "pending",
                                            "paid"
                                        ]
                                    },
                                    "amount": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            },
                            "example": {
                                "status": "none",
                                "amount": 4.5
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/recheck": {
            "post": {
                "operationId": "mysteryVisitsRecheck",
                "summary": "Re-run fraud checks",
                "description": "Recalculates automatic flags: geolocation, time on site, receipt, photo metadata, duplicates.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_recheck",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/reject": {
            "post": {
                "operationId": "mysteryVisitsReject",
                "summary": "Reject a visit",
                "description": "Rejects a submitted questionnaire (e.g. fraud); no payout.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_reject",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 3000
                                    }
                                },
                                "required": [
                                    "note"
                                ]
                            },
                            "example": {
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/reopen": {
            "post": {
                "operationId": "mysteryVisitsReopen",
                "summary": "Reopen a visit",
                "description": "Reopens a cancelled or expired visit with a new deadline.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_reopen",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "window_to": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time",
                                        "description": "New deadline (future)"
                                    }
                                }
                            },
                            "example": {
                                "window_to": "2026-11-03T09:00:00+05:00"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/mystery/visits/{id}/return": {
            "post": {
                "operationId": "mysteryVisitsReturn",
                "summary": "Return a visit to the guest",
                "description": "Sends a submitted questionnaire back for corrections with a comment; the guest gets the link again.",
                "tags": [
                    "Mystery shopper"
                ],
                "x-mcp-tool": "mystery_visits_return",
                "x-permissions": [
                    "mystery.manage"
                ],
                "x-plan-feature": "mystery",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Visit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 3000
                                    }
                                },
                                "required": [
                                    "note"
                                ]
                            },
                            "example": {
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "managed": {
                                                    "type": "boolean"
                                                },
                                                "order_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "wave": {
                                                    "type": "string"
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "score": {
                                                    "type": "number"
                                                },
                                                "level": {
                                                    "type": "string"
                                                },
                                                "submitted_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "guest_url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "audit_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payout_status": {
                                                    "type": "string"
                                                },
                                                "payout_amount": {
                                                    "type": "integer"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "brief": {
                                                    "type": "string"
                                                },
                                                "legend": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "require_receipt": {
                                                            "type": "boolean"
                                                        },
                                                        "require_geo": {
                                                            "type": "boolean"
                                                        },
                                                        "require_timing": {
                                                            "type": "boolean"
                                                        },
                                                        "require_staff": {
                                                            "type": "boolean"
                                                        },
                                                        "require_audio": {
                                                            "type": "boolean"
                                                        },
                                                        "require_place_photos": {
                                                            "type": "boolean"
                                                        },
                                                        "review_required": {
                                                            "type": "boolean"
                                                        },
                                                        "min_minutes": {
                                                            "type": "integer"
                                                        },
                                                        "geo_radius": {
                                                            "type": "integer"
                                                        },
                                                        "receipt_limit": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "shopper_contacts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "answers": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "v": {
                                                                    "type": "integer"
                                                                },
                                                                "c": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "results": {
                                                    "type": "object",
                                                    "properties": {
                                                        "8812": {
                                                            "type": "object",
                                                            "properties": {
                                                                "r": {
                                                                    "type": "integer"
                                                                },
                                                                "t": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "timing": {
                                                    "type": "object",
                                                    "properties": {
                                                        "arrived": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "left": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        }
                                                    }
                                                },
                                                "report": {
                                                    "type": "object",
                                                    "properties": {
                                                        "staff_name": {
                                                            "type": "string"
                                                        },
                                                        "receipt_amount": {
                                                            "type": "integer"
                                                        },
                                                        "summary": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "geo_start": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        },
                                                        "acc": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "geo_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "geo_ref": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "distance_m": {
                                                    "type": "integer"
                                                },
                                                "duration_sec": {
                                                    "type": "integer"
                                                },
                                                "flags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "level": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "sections_score": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "score": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "ai_check": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "review_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewer": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "reviewed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned_count": {
                                                    "type": "integer"
                                                },
                                                "audit": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "invited_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "opened_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "hint": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "questions": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "section_id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "hint": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "settings": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "weight": {
                                                                            "type": "integer"
                                                                        },
                                                                        "can_skip": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "files": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "question_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "taken_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "mime": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "duration": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "size": {
                                                                "type": "integer"
                                                            },
                                                            "transcript": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "user": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "note": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 2041,
                                        "uuid": "9e8d7c6b-5a49-4382-9716-05f4e3d2c1b0",
                                        "status": "submitted",
                                        "managed": false,
                                        "order_uuid": null,
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "checklist": {
                                            "id": 310,
                                            "name": "Guest experience"
                                        },
                                        "shopper": {
                                            "id": 55,
                                            "name": "Madina K."
                                        },
                                        "wave": "November",
                                        "window_from": "2026-11-01T09:00:00+05:00",
                                        "window_to": "2026-11-07T21:00:00+05:00",
                                        "score": 87.5,
                                        "level": "warning",
                                        "submitted_at": "2026-11-03T13:40:00+05:00",
                                        "created_at": "2026-10-30T10:00:00+05:00",
                                        "guest_url": "https://app.jecheck.io/mg/Ab12Cd34Ef56Gh78Ij90Kl12",
                                        "audit_uuid": null,
                                        "payout_status": "pending",
                                        "payout_amount": 4500,
                                        "updated_at": "2026-11-03T13:40:00+05:00",
                                        "url": "https://app.jecheck.io/ui/mystery/visits/2041",
                                        "address": "12 Abay Ave",
                                        "brief": "Order a cappuccino and a dessert",
                                        "legend": "Ask about vegan options",
                                        "settings": {
                                            "require_receipt": true,
                                            "require_geo": true,
                                            "require_timing": true,
                                            "require_staff": true,
                                            "require_audio": false,
                                            "require_place_photos": false,
                                            "review_required": true,
                                            "min_minutes": 10,
                                            "geo_radius": 300,
                                            "receipt_limit": 5000,
                                            "currency": "KZT"
                                        },
                                        "shopper_contacts": {
                                            "email": "madina@example.com",
                                            "phone": "+7 701 000 00 00"
                                        },
                                        "answers": {
                                            "8812": {
                                                "v": 1,
                                                "c": "Greeted within 10 seconds"
                                            }
                                        },
                                        "results": {
                                            "8812": {
                                                "r": 1,
                                                "t": "Yes"
                                            }
                                        },
                                        "timing": {
                                            "arrived": "2026-11-03T13:05:00+05:00",
                                            "left": "2026-11-03T13:31:00+05:00"
                                        },
                                        "report": {
                                            "staff_name": "Aliya",
                                            "receipt_amount": 4500,
                                            "summary": "Friendly service, long wait for dessert"
                                        },
                                        "geo_start": {
                                            "lat": 43.2389,
                                            "lng": 76.9455,
                                            "acc": 12
                                        },
                                        "geo_end": null,
                                        "geo_ref": {
                                            "lat": 43.2391,
                                            "lng": 76.9452
                                        },
                                        "distance_m": 35,
                                        "duration_sec": 1560,
                                        "flags": [
                                            {
                                                "code": "short_visit",
                                                "level": "warning",
                                                "text": "The visit took less than the minimum time"
                                            }
                                        ],
                                        "sections_score": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "score": 90
                                            }
                                        ],
                                        "ai_check": null,
                                        "review_note": null,
                                        "reviewer": null,
                                        "reviewed_at": null,
                                        "returned_count": 0,
                                        "audit": null,
                                        "invited_at": "2026-10-30T10:01:00+05:00",
                                        "opened_at": "2026-11-03T12:58:00+05:00",
                                        "started_at": "2026-11-03T13:02:00+05:00",
                                        "form": [
                                            {
                                                "id": 101,
                                                "name": "Service",
                                                "hint": null,
                                                "questions": [
                                                    {
                                                        "id": 8812,
                                                        "section_id": 101,
                                                        "name": "Were you greeted?",
                                                        "hint": null,
                                                        "type": "yes_no",
                                                        "settings": null,
                                                        "weight": 1,
                                                        "can_skip": false,
                                                        "photo": false
                                                    }
                                                ]
                                            }
                                        ],
                                        "files": [
                                            {
                                                "id": 9001,
                                                "question_id": null,
                                                "kind": "receipt",
                                                "url": "https://files.jecheck.io/mystery/761/receipt.jpg",
                                                "taken_at": "2026-11-03T13:30:00+05:00",
                                                "mime": "image/jpeg",
                                                "name": null,
                                                "duration": null,
                                                "size": 182044,
                                                "transcript": null
                                            }
                                        ],
                                        "events": [
                                            {
                                                "type": "submitted",
                                                "at": "2026-11-03T13:40:00+05:00",
                                                "user": null,
                                                "note": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/notifications": {
            "get": {
                "operationId": "notificationsList",
                "summary": "List notifications",
                "description": "Notifications of the acting user, newest first. `meta.unread` — the number of unread notifications.",
                "tags": [
                    "Notifications"
                ],
                "x-mcp-tool": "notifications_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "unread",
                        "in": "query",
                        "description": "Only unread notifications",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "description": "Only notifications created after this moment",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "body": {
                                                        "type": "string"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "data": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "task_id": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            }
                                                        }
                                                    },
                                                    "is_read": {
                                                        "type": "boolean"
                                                    },
                                                    "read_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 88123,
                                            "title": "New task: Replace the broken fridge seal",
                                            "body": "Abay Ave · due Nov 10",
                                            "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "data": {
                                                "type": "task",
                                                "task_id": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                            },
                                            "is_read": false,
                                            "read_at": null,
                                            "created_at": "2026-11-03T10:24:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/notifications/preferences": {
            "get": {
                "operationId": "notificationsPreferencesGet",
                "summary": "Get notification settings",
                "description": "Personal settings by channel (`push`, `email`) and event group: `assigned` — a task is assigned, `comments`, `updates` — status and due-date changes, `reminders` — due and overdue reminders, `digest` — daily email digest, `brief` — morning AI-control brief, `urgent` — urgent signals during the day. The in-app history is always kept.",
                "tags": [
                    "Notifications"
                ],
                "x-mcp-tool": "notifications_preferences_get",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "push": {
                                                    "type": "object",
                                                    "properties": {
                                                        "assigned": {
                                                            "type": "boolean"
                                                        },
                                                        "comments": {
                                                            "type": "boolean"
                                                        },
                                                        "updates": {
                                                            "type": "boolean"
                                                        },
                                                        "reminders": {
                                                            "type": "boolean"
                                                        },
                                                        "brief": {
                                                            "type": "boolean"
                                                        },
                                                        "urgent": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "email": {
                                                    "type": "object",
                                                    "properties": {
                                                        "assigned": {
                                                            "type": "boolean"
                                                        },
                                                        "digest": {
                                                            "type": "boolean"
                                                        },
                                                        "brief": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "push": {
                                            "assigned": true,
                                            "comments": true,
                                            "updates": true,
                                            "reminders": true,
                                            "brief": true,
                                            "urgent": true
                                        },
                                        "email": {
                                            "assigned": true,
                                            "digest": false,
                                            "brief": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "notificationsPreferencesUpdate",
                "summary": "Update notification settings",
                "description": "Partial update: pass only the switches to change, e.g. `{\"email\": {\"digest\": false}}`. Unknown keys are ignored.",
                "tags": [
                    "Notifications"
                ],
                "x-mcp-tool": "notifications_preferences_update",
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "push": {
                                        "type": "object",
                                        "properties": {
                                            "assigned": {
                                                "type": "boolean"
                                            },
                                            "comments": {
                                                "type": "boolean"
                                            },
                                            "updates": {
                                                "type": "boolean"
                                            },
                                            "reminders": {
                                                "type": "boolean"
                                            },
                                            "brief": {
                                                "type": "boolean"
                                            },
                                            "urgent": {
                                                "type": "boolean"
                                            }
                                        },
                                        "description": "Push notifications to the mobile app"
                                    },
                                    "email": {
                                        "type": "object",
                                        "properties": {
                                            "assigned": {
                                                "type": "boolean"
                                            },
                                            "digest": {
                                                "type": "boolean"
                                            },
                                            "brief": {
                                                "type": "boolean"
                                            },
                                            "routines": {
                                                "type": "boolean"
                                            }
                                        },
                                        "description": "Emails (only for users with web-cabinet access)"
                                    }
                                }
                            },
                            "example": {
                                "push": {
                                    "assigned": true,
                                    "comments": true,
                                    "updates": true
                                },
                                "email": {
                                    "assigned": true,
                                    "digest": true,
                                    "brief": true
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "push": {
                                                    "type": "object",
                                                    "properties": {
                                                        "assigned": {
                                                            "type": "boolean"
                                                        },
                                                        "comments": {
                                                            "type": "boolean"
                                                        },
                                                        "updates": {
                                                            "type": "boolean"
                                                        },
                                                        "reminders": {
                                                            "type": "boolean"
                                                        },
                                                        "brief": {
                                                            "type": "boolean"
                                                        },
                                                        "urgent": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "email": {
                                                    "type": "object",
                                                    "properties": {
                                                        "assigned": {
                                                            "type": "boolean"
                                                        },
                                                        "digest": {
                                                            "type": "boolean"
                                                        },
                                                        "brief": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "push": {
                                            "assigned": true,
                                            "comments": true,
                                            "updates": true,
                                            "reminders": true,
                                            "brief": true,
                                            "urgent": true
                                        },
                                        "email": {
                                            "assigned": true,
                                            "digest": false,
                                            "brief": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/notifications/read": {
            "post": {
                "operationId": "notificationsRead",
                "summary": "Mark notifications as read",
                "description": "Pass `ids` to mark specific notifications, or `all: true` to mark everything as read. Returns the remaining unread count.",
                "tags": [
                    "Notifications"
                ],
                "x-mcp-tool": "notifications_read",
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Notification ids",
                                        "maxItems": 200
                                    },
                                    "all": {
                                        "type": "boolean",
                                        "description": "Mark all notifications as read"
                                    }
                                }
                            },
                            "example": {
                                "ids": [
                                    12,
                                    14
                                ],
                                "all": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "marked": {
                                                    "type": "integer"
                                                },
                                                "unread": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "marked": 2,
                                        "unread": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/notifications/unread-count": {
            "get": {
                "operationId": "notificationsUnreadCount",
                "summary": "Count unread notifications",
                "tags": [
                    "Notifications"
                ],
                "x-mcp-tool": "notifications_unread_count",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "unread": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "unread": 3
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding": {
            "get": {
                "operationId": "onboardingGet",
                "summary": "Get setup progress",
                "description": "Steps in order with `done` (detected from company data — the demo location and demo checklist created at sign-up do not count), `skipped` and `optional`; `done`/`total` progress (skipped steps are excluded) and whether the Getting started screen is hidden (`dismissed_at`). Step keys: company, locations, people, checklist, app, audit, fixes, planner, call.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_get",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "steps": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "optional": {
                                                                "type": "boolean"
                                                            },
                                                            "done": {
                                                                "type": "boolean"
                                                            },
                                                            "skipped": {
                                                                "type": "boolean"
                                                            },
                                                            "facts": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "done": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "complete": {
                                                    "type": "boolean"
                                                },
                                                "dismissed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "steps": [
                                            {
                                                "key": "locations",
                                                "optional": false,
                                                "done": true,
                                                "skipped": false,
                                                "facts": 3
                                            }
                                        ],
                                        "done": 7,
                                        "total": 9,
                                        "complete": false,
                                        "dismissed_at": null,
                                        "active": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding/dismiss": {
            "post": {
                "operationId": "onboardingDismiss",
                "summary": "Hide the Getting started screen",
                "description": "The home page shows the AI control brief instead. The screen stays available at /ui/start.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_dismiss",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "ok": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding/meetings": {
            "get": {
                "operationId": "onboardingMeetingsList",
                "summary": "List the company's calls with managers",
                "description": "Upcoming and past calls (newest first), with the room link and status: booked, cancelled, done, no_show.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_meetings_list",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "topic": {
                                                                "type": "string"
                                                            },
                                                            "comment": {
                                                                "type": "string"
                                                            },
                                                            "phone": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "starts_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "ends_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "provider": {
                                                                "type": "string"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            },
                                                            "manager": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "photo": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    }
                                                                }
                                                            },
                                                            "ics_url": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "data": [
                                            {
                                                "uuid": "0b9e6c2a-6f1e-4c55-9a0b-1f2e3d4c5b6a",
                                                "status": "booked",
                                                "topic": "setup",
                                                "comment": "We have 5 coffee shops",
                                                "phone": null,
                                                "starts_at": "2026-11-12T11:00:00+05:00",
                                                "ends_at": "2026-11-12T11:30:00+05:00",
                                                "provider": "zoom",
                                                "url": "https://zoom.us/j/1234567890",
                                                "manager": {
                                                    "id": 1,
                                                    "name": "Aliya Seitova",
                                                    "title": "Customer success manager",
                                                    "photo": null
                                                },
                                                "ics_url": "/ui/start/meetings/0b9e6c2a-6f1e-4c55-9a0b-1f2e3d4c5b6a/ics"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "onboardingMeetingsBook",
                "summary": "Book a call with a manager",
                "description": "Books a free slot from `GET /onboarding/slots`. The room is the manager's permanent Zoom room; both sides get an email with a calendar invite, the client gets a reminder an hour before. A company has one active booking — booking again reschedules it.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_meetings_book",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "start": {
                                        "type": "string",
                                        "format": "date-time",
                                        "description": "Slot start from `GET /onboarding/slots` (ISO 8601 with offset)"
                                    },
                                    "manager_id": {
                                        "type": "integer",
                                        "description": "Preferred manager; by default the least busy free one"
                                    },
                                    "provider": {
                                        "type": "string",
                                        "enum": [
                                            "zoom"
                                        ],
                                        "description": "Video service — currently only zoom"
                                    },
                                    "topic": {
                                        "type": "string",
                                        "enum": [
                                            "setup",
                                            "demo",
                                            "pricing",
                                            "other"
                                        ],
                                        "default": "setup"
                                    },
                                    "comment": {
                                        "type": "string",
                                        "description": "What to discuss",
                                        "maxLength": 2000
                                    },
                                    "phone": {
                                        "type": "string",
                                        "maxLength": 40
                                    }
                                },
                                "required": [
                                    "start"
                                ]
                            },
                            "example": {
                                "start": "2026-11-03T09:00:00+05:00",
                                "manager_id": 42,
                                "provider": "zoom",
                                "topic": "setup"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "meeting": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "topic": {
                                                            "type": "string"
                                                        },
                                                        "comment": {
                                                            "type": "string"
                                                        },
                                                        "phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "starts_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "ends_at": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "provider": {
                                                            "type": "string"
                                                        },
                                                        "url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        },
                                                        "manager": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                },
                                                                "photo": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            }
                                                        },
                                                        "ics_url": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "meeting": {
                                            "uuid": "0b9e6c2a-6f1e-4c55-9a0b-1f2e3d4c5b6a",
                                            "status": "booked",
                                            "topic": "setup",
                                            "comment": "We have 5 coffee shops",
                                            "phone": null,
                                            "starts_at": "2026-11-12T11:00:00+05:00",
                                            "ends_at": "2026-11-12T11:30:00+05:00",
                                            "provider": "zoom",
                                            "url": "https://zoom.us/j/1234567890",
                                            "manager": {
                                                "id": 1,
                                                "name": "Aliya Seitova",
                                                "title": "Customer success manager",
                                                "photo": null
                                            },
                                            "ics_url": "/ui/start/meetings/0b9e6c2a-6f1e-4c55-9a0b-1f2e3d4c5b6a/ics"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding/meetings/{uuid}/cancel": {
            "post": {
                "operationId": "onboardingMeetingsCancel",
                "summary": "Cancel a call",
                "description": "The manager gets an email; the calendar event is cancelled.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_meetings_cancel",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 500
                                    }
                                }
                            },
                            "example": {
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "ok": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding/restore": {
            "post": {
                "operationId": "onboardingRestore",
                "summary": "Show the Getting started screen again",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_restore",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "write",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "ok": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding/slots": {
            "get": {
                "operationId": "onboardingSlots",
                "summary": "Free time slots for a call with a manager",
                "description": "Days ahead with free slots in the company time zone. Each slot lists the managers free at that time; pass `start` (and optionally `manager_id`) to book it.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_slots",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "manager_id",
                        "in": "query",
                        "description": "Only this manager",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "tz": {
                                                    "type": "string"
                                                },
                                                "days": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "slots": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "start": {
                                                                            "type": "string",
                                                                            "format": "date-time"
                                                                        },
                                                                        "time": {
                                                                            "type": "string"
                                                                        },
                                                                        "managers": {
                                                                            "type": "array",
                                                                            "items": {
                                                                                "type": "integer"
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "tz": "Asia/Almaty",
                                        "days": [
                                            {
                                                "date": "2026-11-12",
                                                "slots": [
                                                    {
                                                        "start": "2026-11-12T11:00:00+05:00",
                                                        "time": "11:00",
                                                        "managers": [
                                                            1
                                                        ]
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/onboarding/steps/{step}/skip": {
            "post": {
                "operationId": "onboardingStepsSkip",
                "summary": "Skip or restore an optional step",
                "description": "Only optional steps (`planner`, `call`) can be skipped. Returns the updated progress.",
                "tags": [
                    "Getting started"
                ],
                "x-mcp-tool": "onboarding_steps_skip",
                "x-permissions": [
                    "start.view"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "description": "Step key",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "planner",
                                "call"
                            ]
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "skip": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "`false` — bring the step back"
                                    }
                                }
                            },
                            "example": {
                                "skip": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "steps": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "optional": {
                                                                "type": "boolean"
                                                            },
                                                            "done": {
                                                                "type": "boolean"
                                                            },
                                                            "skipped": {
                                                                "type": "boolean"
                                                            },
                                                            "facts": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "done": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "complete": {
                                                    "type": "boolean"
                                                },
                                                "dismissed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "steps": [
                                            {
                                                "key": "locations",
                                                "optional": false,
                                                "done": true,
                                                "skipped": false,
                                                "facts": 3
                                            }
                                        ],
                                        "done": 7,
                                        "total": 8,
                                        "complete": false,
                                        "dismissed_at": null,
                                        "active": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/audits": {
            "get": {
                "operationId": "plannerAuditsList",
                "summary": "List planned audits",
                "description": "Planned audits (calendar entries) in a date range, ordered by date. The status is computed on read: `done` — marked manually (`done_by: manual`) or matched by a conducted audit of the same checklist and location within the window `date ± tolerance` (`done_by: audit`, `audit_id`); `planned`, `inprogress` (today, start time passed), `overdue` (date passed, window still open), `missed` (window closed). Visible: locations where the token has `planner.view` or `planner.manage`, plus audits assigned to the token user.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "From date (inclusive); default — today",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "To date (inclusive); default — 30 days after `date_from`; the range is limited to 366 days",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "auditor_ids[]",
                        "in": "query",
                        "description": "Only these auditors",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "checklist_ids[]",
                        "in": "query",
                        "description": "Only these checklists",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "status[]",
                        "in": "query",
                        "description": "Filter by status: planned, inprogress, overdue, missed, done",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "mine",
                        "in": "query",
                        "description": "Only audits assigned to the token user",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "time": {
                                                        "type": "string"
                                                    },
                                                    "duration_min": {
                                                        "type": "integer"
                                                    },
                                                    "checklist": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "auditor": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "done_by": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "audit_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "audit_date": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "window_from": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "window_to": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "plan_key": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "series_id": {
                                                        "type": "integer"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 48211,
                                            "date": "2026-11-05",
                                            "time": "09:00",
                                            "duration_min": 60,
                                            "checklist": {
                                                "id": 5845,
                                                "name": "Daily dining room check"
                                            },
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "auditor": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "status": "planned",
                                            "done_by": null,
                                            "audit_id": null,
                                            "audit_date": null,
                                            "window_from": "2026-11-04",
                                            "window_to": "2026-11-06",
                                            "plan_key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                            "series_id": 1842,
                                            "url": "https://app.jecheck.io/ui/planner?date=2026-11-05"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/audits/{id}": {
            "get": {
                "operationId": "plannerAuditsGet",
                "summary": "Retrieve a planned audit",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Planned audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time": {
                                                    "type": "string"
                                                },
                                                "duration_min": {
                                                    "type": "integer"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "done_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "plan_key": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "series_id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 48211,
                                        "date": "2026-11-05",
                                        "time": "09:00",
                                        "duration_min": 60,
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "status": "planned",
                                        "done_by": null,
                                        "audit_id": null,
                                        "audit_date": null,
                                        "window_from": "2026-11-04",
                                        "window_to": "2026-11-06",
                                        "plan_key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                        "series_id": 1842,
                                        "url": "https://app.jecheck.io/ui/planner?date=2026-11-05"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "plannerAuditsCancel",
                "summary": "Cancel a planned audit",
                "description": "Removes one planned audit from its plan. A done audit cannot be cancelled. Requires `planner.manage` on its location.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_cancel",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Planned audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/audits/{id}/complete": {
            "post": {
                "operationId": "plannerAuditsComplete",
                "summary": "Mark a planned audit as done",
                "description": "Manual \"done\" mark (e.g. the audit was done on paper). Allowed with `planner.manage` on the location or to the assigned auditor.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_complete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Planned audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time": {
                                                    "type": "string"
                                                },
                                                "duration_min": {
                                                    "type": "integer"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "done_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "plan_key": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "series_id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 48211,
                                        "date": "2026-11-05",
                                        "time": "09:00",
                                        "duration_min": 60,
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "status": "planned",
                                        "done_by": null,
                                        "audit_id": null,
                                        "audit_date": null,
                                        "window_from": "2026-11-04",
                                        "window_to": "2026-11-06",
                                        "plan_key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                        "series_id": 1842,
                                        "url": "https://app.jecheck.io/ui/planner?date=2026-11-05"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/audits/{id}/reassign": {
            "post": {
                "operationId": "plannerAuditsReassign",
                "summary": "Reassign a planned audit",
                "description": "Assigns the planned audit to another auditor; the checklist must be available to them. Requires `planner.manage` on its location.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_reassign",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Planned audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "auditor_id": {
                                        "type": "integer",
                                        "description": "New auditor (user id)"
                                    }
                                },
                                "required": [
                                    "auditor_id"
                                ]
                            },
                            "example": {
                                "auditor_id": 42
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time": {
                                                    "type": "string"
                                                },
                                                "duration_min": {
                                                    "type": "integer"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "done_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "plan_key": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "series_id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 48211,
                                        "date": "2026-11-05",
                                        "time": "09:00",
                                        "duration_min": 60,
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "status": "planned",
                                        "done_by": null,
                                        "audit_id": null,
                                        "audit_date": null,
                                        "window_from": "2026-11-04",
                                        "window_to": "2026-11-06",
                                        "plan_key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                        "series_id": 1842,
                                        "url": "https://app.jecheck.io/ui/planner?date=2026-11-05"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/audits/{id}/reschedule": {
            "post": {
                "operationId": "plannerAuditsReschedule",
                "summary": "Reschedule a planned audit",
                "description": "Moves the planned audit to another date and/or time; reminders are sent again. Requires `planner.manage` on its location.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_reschedule",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Planned audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "New date"
                                    },
                                    "time": {
                                        "type": "string",
                                        "description": "New start time `HH:MM` (kept if omitted)"
                                    }
                                },
                                "required": [
                                    "date"
                                ]
                            },
                            "example": {
                                "date": "2026-11-01",
                                "time": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time": {
                                                    "type": "string"
                                                },
                                                "duration_min": {
                                                    "type": "integer"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "done_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "plan_key": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "series_id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 48211,
                                        "date": "2026-11-05",
                                        "time": "09:00",
                                        "duration_min": 60,
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "status": "planned",
                                        "done_by": null,
                                        "audit_id": null,
                                        "audit_date": null,
                                        "window_from": "2026-11-04",
                                        "window_to": "2026-11-06",
                                        "plan_key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                        "series_id": 1842,
                                        "url": "https://app.jecheck.io/ui/planner?date=2026-11-05"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/audits/{id}/uncomplete": {
            "post": {
                "operationId": "plannerAuditsUncomplete",
                "summary": "Remove the manual done mark",
                "description": "The status is computed again. Fails with 422 if the audit was not marked manually.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_audits_uncomplete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Planned audit id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "time": {
                                                    "type": "string"
                                                },
                                                "duration_min": {
                                                    "type": "integer"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "done_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "audit_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "window_from": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "window_to": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "plan_key": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "series_id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 48211,
                                        "date": "2026-11-05",
                                        "time": "09:00",
                                        "duration_min": 60,
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "status": "planned",
                                        "done_by": null,
                                        "audit_id": null,
                                        "audit_date": null,
                                        "window_from": "2026-11-04",
                                        "window_to": "2026-11-06",
                                        "plan_key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                        "series_id": 1842,
                                        "url": "https://app.jecheck.io/ui/planner?date=2026-11-05"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/plans": {
            "get": {
                "operationId": "plannerPlansList",
                "summary": "List audit plans",
                "description": "Active plans whose locations are all within the token's `planner.manage` permission. A plan is a set of recurring series of one checklist on several locations.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_plans_list",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "checklist": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "locations": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "auditor": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "recur": {
                                                        "type": "string"
                                                    },
                                                    "weekdays": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "month_days": {
                                                        "type": "array"
                                                    },
                                                    "time": {
                                                        "type": "string"
                                                    },
                                                    "duration_min": {
                                                        "type": "integer"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "end_date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "tolerance_days": {
                                                        "type": "integer"
                                                    },
                                                    "notify": {
                                                        "type": "object",
                                                        "properties": {
                                                            "email": {
                                                                "type": "boolean"
                                                            },
                                                            "day1": {
                                                                "type": "boolean"
                                                            },
                                                            "hour1": {
                                                                "type": "boolean"
                                                            },
                                                            "escalate": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    },
                                                    "series_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                            "title": "Weekly hall check",
                                            "checklist": {
                                                "id": 5845,
                                                "name": "Daily dining room check"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                {
                                                    "id": 14,
                                                    "name": "Dostyk Plaza"
                                                }
                                            ],
                                            "auditor": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "recur": "weekly",
                                            "weekdays": [
                                                1,
                                                4
                                            ],
                                            "month_days": [],
                                            "time": "09:00",
                                            "duration_min": 60,
                                            "start_date": "2026-11-03",
                                            "end_date": "2027-02-03",
                                            "tolerance_days": 1,
                                            "notify": {
                                                "email": true,
                                                "day1": true,
                                                "hour1": false,
                                                "escalate": true
                                            },
                                            "series_ids": [
                                                1842,
                                                1843
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "plannerPlansCreate",
                "summary": "Create an audit plan",
                "description": "Creates a plan: one series per location with planned audits generated by the recurrence rule. Requires `planner.manage` on every location of the plan. The response contains the plan and how many audits were scheduled.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_plans_create",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Plan title; default \"Plan: <checklist>\"",
                                        "maxLength": 255
                                    },
                                    "checklist_id": {
                                        "type": "integer",
                                        "description": "Checklist to audit"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Locations — one series per location",
                                        "minItems": 1
                                    },
                                    "auditor_id": {
                                        "type": "integer",
                                        "description": "Auditor (user id); the checklist must be available to them"
                                    },
                                    "recur": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "daily",
                                            "weekdays",
                                            "weekly",
                                            "monthly"
                                        ],
                                        "description": "`none` — once on `start_date`, `daily`, `weekdays` (Mon–Fri), `weekly` (on `weekdays`), `monthly` (on `month_days`)"
                                    },
                                    "weekdays": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "For `weekly`: days of week, 0 = Sunday … 6 = Saturday"
                                    },
                                    "month_days": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "For `monthly`: days of month 1–31"
                                    },
                                    "time": {
                                        "type": "string",
                                        "description": "Start time `HH:MM`, default 09:00"
                                    },
                                    "duration_min": {
                                        "type": "integer",
                                        "description": "Planned duration, minutes (default 60)",
                                        "minimum": 5,
                                        "maximum": 1440
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "First day of the plan"
                                    },
                                    "end_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Last day; default depends on the recurrence"
                                    },
                                    "tolerance_days": {
                                        "type": "integer",
                                        "description": "An audit conducted within ± this many days of the planned date counts; default depends on the frequency",
                                        "minimum": 0,
                                        "maximum": 14
                                    },
                                    "notify": {
                                        "type": "object",
                                        "properties": {
                                            "email": {
                                                "type": "boolean",
                                                "description": "Email the auditor about the plan"
                                            },
                                            "day1": {
                                                "type": "boolean",
                                                "description": "Remind a day before"
                                            },
                                            "hour1": {
                                                "type": "boolean",
                                                "description": "Remind an hour before"
                                            },
                                            "escalate": {
                                                "type": "boolean",
                                                "description": "Notify managers about missed audits"
                                            }
                                        },
                                        "description": "Notifications"
                                    }
                                },
                                "required": [
                                    "checklist_id",
                                    "location_ids",
                                    "auditor_id",
                                    "recur",
                                    "start_date"
                                ]
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "checklist_id": 42,
                                "location_ids": [
                                    12,
                                    14
                                ],
                                "auditor_id": 42,
                                "recur": "none",
                                "start_date": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "plan": {
                                                    "type": "object",
                                                    "properties": {
                                                        "key": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "checklist": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "auditor": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "recur": {
                                                            "type": "string"
                                                        },
                                                        "weekdays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "month_days": {
                                                            "type": "array"
                                                        },
                                                        "time": {
                                                            "type": "string"
                                                        },
                                                        "duration_min": {
                                                            "type": "integer"
                                                        },
                                                        "start_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "end_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "tolerance_days": {
                                                            "type": "integer"
                                                        },
                                                        "notify": {
                                                            "type": "object",
                                                            "properties": {
                                                                "email": {
                                                                    "type": "boolean"
                                                                },
                                                                "day1": {
                                                                    "type": "boolean"
                                                                },
                                                                "hour1": {
                                                                    "type": "boolean"
                                                                },
                                                                "escalate": {
                                                                    "type": "boolean"
                                                                }
                                                            }
                                                        },
                                                        "series_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "scheduled": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "plan": {
                                            "key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                            "title": "Weekly hall check",
                                            "checklist": {
                                                "id": 5845,
                                                "name": "Daily dining room check"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                {
                                                    "id": 14,
                                                    "name": "Dostyk Plaza"
                                                }
                                            ],
                                            "auditor": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "recur": "weekly",
                                            "weekdays": [
                                                1,
                                                4
                                            ],
                                            "month_days": [],
                                            "time": "09:00",
                                            "duration_min": 60,
                                            "start_date": "2026-11-03",
                                            "end_date": "2027-02-03",
                                            "tolerance_days": 1,
                                            "notify": {
                                                "email": true,
                                                "day1": true,
                                                "hour1": false,
                                                "escalate": true
                                            },
                                            "series_ids": [
                                                1842,
                                                1843
                                            ]
                                        },
                                        "scheduled": 28
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/plans/{key}": {
            "get": {
                "operationId": "plannerPlansGet",
                "summary": "Retrieve an audit plan",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_plans_get",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "description": "Plan key (UUID, or `s<id>` for older single-series plans)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "key": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "checklist": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "auditor": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "recur": {
                                                    "type": "string"
                                                },
                                                "weekdays": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "month_days": {
                                                    "type": "array"
                                                },
                                                "time": {
                                                    "type": "string"
                                                },
                                                "duration_min": {
                                                    "type": "integer"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "end_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "tolerance_days": {
                                                    "type": "integer"
                                                },
                                                "notify": {
                                                    "type": "object",
                                                    "properties": {
                                                        "email": {
                                                            "type": "boolean"
                                                        },
                                                        "day1": {
                                                            "type": "boolean"
                                                        },
                                                        "hour1": {
                                                            "type": "boolean"
                                                        },
                                                        "escalate": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "series_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                        "title": "Weekly hall check",
                                        "checklist": {
                                            "id": 5845,
                                            "name": "Daily dining room check"
                                        },
                                        "locations": [
                                            {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            {
                                                "id": 14,
                                                "name": "Dostyk Plaza"
                                            }
                                        ],
                                        "auditor": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "recur": "weekly",
                                        "weekdays": [
                                            1,
                                            4
                                        ],
                                        "month_days": [],
                                        "time": "09:00",
                                        "duration_min": 60,
                                        "start_date": "2026-11-03",
                                        "end_date": "2027-02-03",
                                        "tolerance_days": 1,
                                        "notify": {
                                            "email": true,
                                            "day1": true,
                                            "hour1": false,
                                            "escalate": true
                                        },
                                        "series_ids": [
                                            1842,
                                            1843
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "plannerPlansUpdate",
                "summary": "Update an audit plan",
                "description": "Replaces the plan settings. Past audits stay as they are; upcoming ones (from today, except done) are regenerated. Removed locations lose their series, added ones get new series. Requires `planner.manage` on the old and new locations. `upcoming` — planned audits from today.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_plans_update",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "description": "Plan key (UUID, or `s<id>` for older single-series plans)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Plan title; default \"Plan: <checklist>\"",
                                        "maxLength": 255
                                    },
                                    "checklist_id": {
                                        "type": "integer",
                                        "description": "Checklist to audit"
                                    },
                                    "location_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Locations — one series per location",
                                        "minItems": 1
                                    },
                                    "auditor_id": {
                                        "type": "integer",
                                        "description": "Auditor (user id); the checklist must be available to them"
                                    },
                                    "recur": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "daily",
                                            "weekdays",
                                            "weekly",
                                            "monthly"
                                        ],
                                        "description": "`none` — once on `start_date`, `daily`, `weekdays` (Mon–Fri), `weekly` (on `weekdays`), `monthly` (on `month_days`)"
                                    },
                                    "weekdays": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "For `weekly`: days of week, 0 = Sunday … 6 = Saturday"
                                    },
                                    "month_days": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "For `monthly`: days of month 1–31"
                                    },
                                    "time": {
                                        "type": "string",
                                        "description": "Start time `HH:MM`, default 09:00"
                                    },
                                    "duration_min": {
                                        "type": "integer",
                                        "description": "Planned duration, minutes (default 60)",
                                        "minimum": 5,
                                        "maximum": 1440
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "First day of the plan"
                                    },
                                    "end_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Last day; default depends on the recurrence"
                                    },
                                    "tolerance_days": {
                                        "type": "integer",
                                        "description": "An audit conducted within ± this many days of the planned date counts; default depends on the frequency",
                                        "minimum": 0,
                                        "maximum": 14
                                    },
                                    "notify": {
                                        "type": "object",
                                        "properties": {
                                            "email": {
                                                "type": "boolean",
                                                "description": "Email the auditor about the plan"
                                            },
                                            "day1": {
                                                "type": "boolean",
                                                "description": "Remind a day before"
                                            },
                                            "hour1": {
                                                "type": "boolean",
                                                "description": "Remind an hour before"
                                            },
                                            "escalate": {
                                                "type": "boolean",
                                                "description": "Notify managers about missed audits"
                                            }
                                        },
                                        "description": "Notifications"
                                    }
                                },
                                "required": [
                                    "checklist_id",
                                    "location_ids",
                                    "auditor_id",
                                    "recur",
                                    "start_date"
                                ]
                            },
                            "example": {
                                "title": "Replace the broken fridge seal",
                                "checklist_id": 42,
                                "location_ids": [
                                    12,
                                    14
                                ],
                                "auditor_id": 42,
                                "recur": "none",
                                "start_date": "2026-11-01"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "plan": {
                                                    "type": "object",
                                                    "properties": {
                                                        "key": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "checklist": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "auditor": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "uuid": {
                                                                    "type": "string",
                                                                    "format": "uuid"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "recur": {
                                                            "type": "string"
                                                        },
                                                        "weekdays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "month_days": {
                                                            "type": "array"
                                                        },
                                                        "time": {
                                                            "type": "string"
                                                        },
                                                        "duration_min": {
                                                            "type": "integer"
                                                        },
                                                        "start_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "end_date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "tolerance_days": {
                                                            "type": "integer"
                                                        },
                                                        "notify": {
                                                            "type": "object",
                                                            "properties": {
                                                                "email": {
                                                                    "type": "boolean"
                                                                },
                                                                "day1": {
                                                                    "type": "boolean"
                                                                },
                                                                "hour1": {
                                                                    "type": "boolean"
                                                                },
                                                                "escalate": {
                                                                    "type": "boolean"
                                                                }
                                                            }
                                                        },
                                                        "series_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "upcoming": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "plan": {
                                            "key": "0b7c1f9e-2d4a-4f6b-8e3c-5a9d7b1c2e4f",
                                            "title": "Weekly hall check",
                                            "checklist": {
                                                "id": 5845,
                                                "name": "Daily dining room check"
                                            },
                                            "locations": [
                                                {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                {
                                                    "id": 14,
                                                    "name": "Dostyk Plaza"
                                                }
                                            ],
                                            "auditor": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "recur": "weekly",
                                            "weekdays": [
                                                1,
                                                4
                                            ],
                                            "month_days": [],
                                            "time": "09:00",
                                            "duration_min": 60,
                                            "start_date": "2026-11-03",
                                            "end_date": "2027-02-03",
                                            "tolerance_days": 1,
                                            "notify": {
                                                "email": true,
                                                "day1": true,
                                                "hour1": false,
                                                "escalate": true
                                            },
                                            "series_ids": [
                                                1842,
                                                1843
                                            ]
                                        },
                                        "upcoming": 18
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "plannerPlansDelete",
                "summary": "Delete an audit plan",
                "description": "Stops the plan: its series are retired and upcoming planned audits (except done) are removed; history stays. `removed` — how many upcoming audits were removed.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_plans_delete",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "key",
                        "in": "path",
                        "required": true,
                        "description": "Plan key (UUID, or `s<id>` for older single-series plans)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "removed": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true,
                                        "removed": 12
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/templates": {
            "get": {
                "operationId": "plannerTemplatesList",
                "summary": "List plan templates",
                "description": "Saved plan settings shared in the company, to create similar plans quickly.",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_templates_list",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "settings": {
                                                        "type": "object",
                                                        "properties": {
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "checklist_id": {
                                                                "type": "integer"
                                                            },
                                                            "location_ids": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "auditor_id": {
                                                                "type": "integer"
                                                            },
                                                            "recur": {
                                                                "type": "string"
                                                            },
                                                            "weekdays": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "month_days": {
                                                                "type": "array"
                                                            },
                                                            "time": {
                                                                "type": "string"
                                                            },
                                                            "duration_min": {
                                                                "type": "integer"
                                                            },
                                                            "tolerance_days": {
                                                                "type": "integer"
                                                            },
                                                            "notify": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "email": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "day1": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "hour1": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "escalate": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 7,
                                            "name": "Weekly hall check",
                                            "settings": {
                                                "title": "Weekly hall check",
                                                "checklist_id": 5845,
                                                "location_ids": [
                                                    12,
                                                    14
                                                ],
                                                "auditor_id": 311,
                                                "recur": "weekly",
                                                "weekdays": [
                                                    1,
                                                    4
                                                ],
                                                "month_days": [],
                                                "time": "09:00",
                                                "duration_min": 60,
                                                "tolerance_days": 1,
                                                "notify": {
                                                    "email": true,
                                                    "day1": true,
                                                    "hour1": false,
                                                    "escalate": true
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "plannerTemplatesCreate",
                "summary": "Save a plan template",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_templates_create",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Template name",
                                        "minLength": 1,
                                        "maxLength": 255
                                    },
                                    "settings": {
                                        "type": "object",
                                        "properties": {
                                            "title": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            },
                                            "checklist_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            },
                                            "location_ids": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                }
                                            },
                                            "auditor_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            },
                                            "recur": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "enum": [
                                                    "none",
                                                    "daily",
                                                    "weekdays",
                                                    "weekly",
                                                    "monthly"
                                                ]
                                            },
                                            "weekdays": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                }
                                            },
                                            "month_days": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer"
                                                }
                                            },
                                            "time": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 5
                                            },
                                            "duration_min": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 5,
                                                "maximum": 1440
                                            },
                                            "tolerance_days": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "minimum": 0,
                                                "maximum": 14
                                            },
                                            "notify": {
                                                "type": "object",
                                                "properties": {},
                                                "additionalProperties": true
                                            }
                                        },
                                        "description": "Any subset of the plan fields (same names as in `planner.plans.create`)"
                                    }
                                },
                                "required": [
                                    "name",
                                    "settings"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "settings": {
                                    "title": "Replace the broken fridge seal",
                                    "checklist_id": 42,
                                    "location_ids": [
                                        12,
                                        14
                                    ]
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "string"
                                                        },
                                                        "checklist_id": {
                                                            "type": "integer"
                                                        },
                                                        "location_ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "auditor_id": {
                                                            "type": "integer"
                                                        },
                                                        "recur": {
                                                            "type": "string"
                                                        },
                                                        "weekdays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "month_days": {
                                                            "type": "array"
                                                        },
                                                        "time": {
                                                            "type": "string"
                                                        },
                                                        "duration_min": {
                                                            "type": "integer"
                                                        },
                                                        "tolerance_days": {
                                                            "type": "integer"
                                                        },
                                                        "notify": {
                                                            "type": "object",
                                                            "properties": {
                                                                "email": {
                                                                    "type": "boolean"
                                                                },
                                                                "day1": {
                                                                    "type": "boolean"
                                                                },
                                                                "hour1": {
                                                                    "type": "boolean"
                                                                },
                                                                "escalate": {
                                                                    "type": "boolean"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Weekly hall check",
                                        "settings": {
                                            "title": "Weekly hall check",
                                            "checklist_id": 5845,
                                            "location_ids": [
                                                12,
                                                14
                                            ],
                                            "auditor_id": 311,
                                            "recur": "weekly",
                                            "weekdays": [
                                                1,
                                                4
                                            ],
                                            "month_days": [],
                                            "time": "09:00",
                                            "duration_min": 60,
                                            "tolerance_days": 1,
                                            "notify": {
                                                "email": true,
                                                "day1": true,
                                                "hour1": false,
                                                "escalate": true
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/planner/templates/{id}": {
            "delete": {
                "operationId": "plannerTemplatesDelete",
                "summary": "Delete a plan template",
                "tags": [
                    "Audit planner"
                ],
                "x-mcp-tool": "planner_templates_delete",
                "x-permissions": [
                    "planner.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Template id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes": {
            "get": {
                "operationId": "processesList",
                "summary": "List processes available for requests",
                "description": "Published processes the acting user may submit a request for, with the published form and a summary of the route.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_list",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "prefix": {
                                                        "type": "string"
                                                    },
                                                    "form": {
                                                        "type": "object",
                                                        "properties": {
                                                            "title": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "mode": {
                                                                        "type": "string"
                                                                    },
                                                                    "template": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "description": {
                                                                "type": "boolean"
                                                            },
                                                            "location": {
                                                                "type": "string"
                                                            },
                                                            "priority": {
                                                                "type": "string"
                                                            },
                                                            "priority_value": {
                                                                "type": "string"
                                                            },
                                                            "due": {
                                                                "type": "string"
                                                            },
                                                            "sla_hours": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "fields": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "type": {
                                                                            "type": "string"
                                                                        },
                                                                        "label": {
                                                                            "type": "string"
                                                                        },
                                                                        "required": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "photo": {
                                                                            "type": "boolean"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "location_ids": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "route": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "description": "Buying equipment and supplies",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8",
                                            "prefix": "BUY",
                                            "form": {
                                                "title": {
                                                    "mode": "template",
                                                    "template": "{process} {number}: {f_item}"
                                                },
                                                "description": true,
                                                "location": "required",
                                                "priority": "input",
                                                "priority_value": "medium",
                                                "due": "input",
                                                "sla_hours": null,
                                                "fields": [
                                                    {
                                                        "id": "f_item",
                                                        "type": "text",
                                                        "label": "What to buy",
                                                        "required": true
                                                    },
                                                    {
                                                        "id": "f_sum",
                                                        "type": "money",
                                                        "label": "Amount",
                                                        "required": true
                                                    },
                                                    {
                                                        "id": "f_invoice",
                                                        "type": "file",
                                                        "label": "Invoice",
                                                        "required": false,
                                                        "photo": false
                                                    }
                                                ]
                                            },
                                            "location_ids": null,
                                            "route": [
                                                {
                                                    "type": "approval",
                                                    "name": "Manager approval"
                                                },
                                                {
                                                    "type": "task",
                                                    "name": "Purchase"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/approvals": {
            "get": {
                "operationId": "processesApprovals",
                "summary": "List requests waiting for me",
                "description": "Requests where the acting user must approve or accept the active step (`waiting` = `approval` / `review`), or that were returned to the acting user for rework (`rework`).",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_approvals",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "process": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "icon": {
                                                                "type": "string"
                                                            },
                                                            "color": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "waiting": {
                                                        "type": "string"
                                                    },
                                                    "step": {
                                                        "type": "string"
                                                    },
                                                    "since": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "due_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "author": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "number": "BUY-42",
                                            "title": "Purchase request BUY-42: coffee grinder",
                                            "process": {
                                                "id": 7,
                                                "name": "Purchase request",
                                                "icon": "shopping_cart",
                                                "color": "#5b54e8"
                                            },
                                            "waiting": "approval",
                                            "step": "Manager approval",
                                            "since": "2026-11-03T10:00:00+05:00",
                                            "due_at": "2026-11-04T10:00:00+05:00",
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "author": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/definitions": {
            "get": {
                "operationId": "processesDefinitionsList",
                "summary": "List all processes (library)",
                "description": "All processes of the company including drafts and archived ones, with request counters. Requires `processes.manage` or `processes.reports`.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_list",
                "x-permissions": [
                    "processes.manage",
                    "processes.reports"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "prefix": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "version": {
                                                        "type": "integer"
                                                    },
                                                    "has_unpublished_changes": {
                                                        "type": "boolean"
                                                    },
                                                    "published_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "open_requests": {
                                                        "type": "integer"
                                                    },
                                                    "total_requests": {
                                                        "type": "integer"
                                                    },
                                                    "avg_minutes": {
                                                        "type": "integer"
                                                    },
                                                    "overdue_steps": {
                                                        "type": "integer"
                                                    },
                                                    "fields_count": {
                                                        "type": "integer"
                                                    },
                                                    "route": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "description": "Buying equipment and supplies",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8",
                                            "prefix": "BUY",
                                            "status": "active",
                                            "version": 3,
                                            "has_unpublished_changes": false,
                                            "published_at": "2026-10-20T09:00:00+05:00",
                                            "updated_at": "2026-10-20T09:00:00+05:00",
                                            "open_requests": 4,
                                            "total_requests": 120,
                                            "avg_minutes": 1440,
                                            "overdue_steps": 1,
                                            "fields_count": 5,
                                            "route": [
                                                {
                                                    "type": "approval",
                                                    "name": "Manager approval"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "processesDefinitionsCreate",
                "summary": "Create a process",
                "description": "Creates a draft process, empty or from a template. Publish it with `processes.definitions.publish`.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_create",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "preset": {
                                        "type": "string",
                                        "enum": [
                                            "purchase",
                                            "repair",
                                            "refund",
                                            "writeoff",
                                            "advance",
                                            "access",
                                            "trip"
                                        ],
                                        "description": "Template key"
                                    }
                                }
                            },
                            "example": {
                                "preset": "purchase"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "flow": {
                                                    "type": "object",
                                                    "properties": {
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "approvers": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "kind": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    },
                                                                    "rule": {
                                                                        "type": "string"
                                                                    },
                                                                    "hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "submit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "watchers": {
                                                            "type": "array"
                                                        },
                                                        "author_cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "show_route": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "has_requests": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "status": "active",
                                        "version": 3,
                                        "has_unpublished_changes": false,
                                        "published_at": "2026-10-20T09:00:00+05:00",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "flow": {
                                            "steps": [
                                                {
                                                    "id": "s_approve",
                                                    "type": "approval",
                                                    "approvers": {
                                                        "kind": "manager"
                                                    },
                                                    "rule": "any",
                                                    "hours": 24
                                                }
                                            ]
                                        },
                                        "settings": {
                                            "submit": {
                                                "mode": "all"
                                            },
                                            "locations": null,
                                            "watchers": [],
                                            "author_cancel": true,
                                            "show_route": true
                                        },
                                        "errors": [],
                                        "has_requests": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/order": {
            "put": {
                "operationId": "processesDefinitionsReorder",
                "summary": "Reorder processes",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_reorder",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Process ids in the new order",
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "ids"
                                ]
                            },
                            "example": {
                                "ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "ok": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/presets": {
            "get": {
                "operationId": "processesPresets",
                "summary": "List process templates",
                "description": "Ready-made processes to start from (`preset` in `processes.definitions.create`).",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_presets",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "fields_count": {
                                                        "type": "integer"
                                                    },
                                                    "route": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "key": "purchase",
                                            "name": "Purchase request",
                                            "description": "Approval and purchase",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8",
                                            "fields_count": 5,
                                            "route": [
                                                {
                                                    "type": "approval",
                                                    "name": "Manager approval"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests": {
            "get": {
                "operationId": "processesRequestsList",
                "summary": "List requests",
                "description": "Requests visible to the acting user (same visibility as tasks), newest first.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "process_id",
                        "in": "query",
                        "description": "Only this process",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "state[]",
                        "in": "query",
                        "description": "Route state: running, returned, approved, done, rejected, cancelled",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "mine",
                        "in": "query",
                        "description": "Only requests submitted by the acting user",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "location_ids[]",
                        "in": "query",
                        "description": "Only these locations",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Submitted from (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Submitted to (inclusive)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only requests changed after this moment",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search in title and number",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    },
                                                    "process": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "author": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "location": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "due_date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "started_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "finished_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                            "number": "BUY-42",
                                            "title": "Purchase request BUY-42: coffee grinder",
                                            "status": "approval",
                                            "state": "running",
                                            "process": {
                                                "id": 7,
                                                "name": "Purchase request"
                                            },
                                            "author": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "location": {
                                                "id": 12,
                                                "name": "Abay Ave"
                                            },
                                            "due_date": "2026-11-07",
                                            "started_at": "2026-11-03T10:00:00+05:00",
                                            "finished_at": null,
                                            "updated_at": "2026-11-03T10:05:00+05:00",
                                            "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}": {
            "get": {
                "operationId": "processesRequestsGet",
                "summary": "Retrieve a request and its route",
                "description": "Form answers (file links valid for 1 hour), the route with decisions, the steps ahead (by current answers) and what the acting user may do now (`can`).",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/cancel": {
            "post": {
                "operationId": "processesRequestsCancel",
                "summary": "Cancel a request",
                "description": "The author (if the process allows it) or a user with `processes.override` cancels an open request.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_cancel",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "description": "Reason",
                                        "maxLength": 1000
                                    }
                                }
                            },
                            "example": {
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/complete": {
            "post": {
                "operationId": "processesRequestsComplete",
                "summary": "Complete the work step",
                "description": "Marks the active `task` step of the route as done; the request moves on.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_complete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "comment": {
                                        "type": "string",
                                        "description": "Comment",
                                        "maxLength": 2000
                                    }
                                }
                            },
                            "example": {
                                "comment": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/decide": {
            "post": {
                "operationId": "processesRequestsDecide",
                "summary": "Approve, return or reject a request",
                "description": "Decision of the acting user on the active approval/review step. `return` sends the request back to the author for rework; `reject` is available on approval steps. A comment may be required on reject/return (see `can.comment_required`).",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_decide",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "decision": {
                                        "type": "string",
                                        "enum": [
                                            "approve",
                                            "return",
                                            "reject"
                                        ]
                                    },
                                    "comment": {
                                        "type": "string",
                                        "description": "Comment",
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "decision"
                                ]
                            },
                            "example": {
                                "decision": "approve",
                                "comment": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/delegate": {
            "post": {
                "operationId": "processesRequestsDelegate",
                "summary": "Delegate my decision",
                "description": "Passes the acting user's decision on the active step to another employee (if the step allows delegation).",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_delegate",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer",
                                        "description": "Employee to delegate to"
                                    },
                                    "comment": {
                                        "type": "string",
                                        "description": "Comment",
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "user_id"
                                ]
                            },
                            "example": {
                                "user_id": 42,
                                "comment": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/move": {
            "post": {
                "operationId": "processesRequestsMove",
                "summary": "Move a request to another step",
                "description": "Intervention: returns the request to a step of the route (`override_steps[].key`). Requires `processes.override`.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_move",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "step": {
                                        "type": "string",
                                        "description": "Step key",
                                        "maxLength": 20
                                    }
                                },
                                "required": [
                                    "step"
                                ]
                            },
                            "example": {
                                "step": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/reassign": {
            "post": {
                "operationId": "processesRequestsReassign",
                "summary": "Replace people on the active step",
                "description": "Intervention: replaces approvers / executors of the active step. Requires `processes.override`.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_reassign",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                    }
                                },
                                "required": [
                                    "user_ids"
                                ]
                            },
                            "example": {
                                "user_ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/resubmit": {
            "post": {
                "operationId": "processesRequestsResubmit",
                "summary": "Resubmit a returned request",
                "description": "The author sends a returned request again, optionally with corrected answers and title.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_resubmit",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "values": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Corrected answers: {\"<field id>\": value}"
                                    },
                                    "title": {
                                        "type": "string",
                                        "maxLength": 512
                                    }
                                }
                            },
                            "example": {
                                "values": [],
                                "title": "Replace the broken fridge seal"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/skip": {
            "post": {
                "operationId": "processesRequestsSkip",
                "summary": "Skip the active step",
                "description": "Intervention: skips the active step of the route. Requires `processes.override` for the request location.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_skip",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/requests/{uuid}/values": {
            "patch": {
                "operationId": "processesRequestsValues",
                "summary": "Edit request answers",
                "description": "Changes answers of an open request — allowed when `can.edit_values` is true (the author before decisions, or `processes.override`).",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_values",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Request (task) UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "values": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Answers to change: {\"<field id>\": value}"
                                    },
                                    "title": {
                                        "type": "string",
                                        "maxLength": 512
                                    }
                                }
                            },
                            "example": {
                                "values": [],
                                "title": "Replace the broken fridge seal"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}": {
            "get": {
                "operationId": "processesGet",
                "summary": "Retrieve a process form",
                "description": "The published form of a process the acting user may submit. Field ids are the keys of `values` when submitting.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "location_ids": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "location_ids": null,
                                        "route": [
                                            {
                                                "type": "approval",
                                                "name": "Manager approval"
                                            },
                                            {
                                                "type": "task",
                                                "name": "Purchase"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "processesDefinitionsDelete",
                "summary": "Delete a process",
                "description": "Only a process without requests can be deleted; otherwise archive it.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_delete",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}/archive": {
            "post": {
                "operationId": "processesDefinitionsArchive",
                "summary": "Archive or restore a process",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_archive",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "archived": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "`true` — archive, `false` — restore"
                                    }
                                }
                            },
                            "example": {
                                "archived": true
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "flow": {
                                                    "type": "object",
                                                    "properties": {
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "approvers": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "kind": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    },
                                                                    "rule": {
                                                                        "type": "string"
                                                                    },
                                                                    "hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "submit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "watchers": {
                                                            "type": "array"
                                                        },
                                                        "author_cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "show_route": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "has_requests": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "status": "active",
                                        "version": 3,
                                        "has_unpublished_changes": false,
                                        "published_at": "2026-10-20T09:00:00+05:00",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "flow": {
                                            "steps": [
                                                {
                                                    "id": "s_approve",
                                                    "type": "approval",
                                                    "approvers": {
                                                        "kind": "manager"
                                                    },
                                                    "rule": "any",
                                                    "hours": 24
                                                }
                                            ]
                                        },
                                        "settings": {
                                            "submit": {
                                                "mode": "all"
                                            },
                                            "locations": null,
                                            "watchers": [],
                                            "author_cancel": true,
                                            "show_route": true
                                        },
                                        "errors": [],
                                        "has_requests": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}/definition": {
            "get": {
                "operationId": "processesDefinitionsGet",
                "summary": "Retrieve a process definition",
                "description": "Draft form, route and settings of a process, validation errors that block publishing and whether it has unpublished changes.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_get",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "flow": {
                                                    "type": "object",
                                                    "properties": {
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "approvers": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "kind": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    },
                                                                    "rule": {
                                                                        "type": "string"
                                                                    },
                                                                    "hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "submit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "watchers": {
                                                            "type": "array"
                                                        },
                                                        "author_cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "show_route": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "has_requests": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "status": "active",
                                        "version": 3,
                                        "has_unpublished_changes": false,
                                        "published_at": "2026-10-20T09:00:00+05:00",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "flow": {
                                            "steps": [
                                                {
                                                    "id": "s_approve",
                                                    "type": "approval",
                                                    "approvers": {
                                                        "kind": "manager"
                                                    },
                                                    "rule": "any",
                                                    "hours": 24
                                                }
                                            ]
                                        },
                                        "settings": {
                                            "submit": {
                                                "mode": "all"
                                            },
                                            "locations": null,
                                            "watchers": [],
                                            "author_cancel": true,
                                            "show_route": true
                                        },
                                        "errors": [],
                                        "has_requests": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "put": {
                "operationId": "processesDefinitionsUpdate",
                "summary": "Save a process draft",
                "description": "Replaces the draft definition. Requests keep using the published version until `processes.definitions.publish`.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_update",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Process name",
                                        "maxLength": 120
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1000
                                    },
                                    "icon": {
                                        "type": "string",
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color",
                                        "maxLength": 9
                                    },
                                    "prefix": {
                                        "type": "string",
                                        "description": "Request number prefix, e.g. `BUY` → BUY-42",
                                        "maxLength": 8
                                    },
                                    "form": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Request form: title mode/template, description/location/priority/due settings and `fields` (types: text, textarea, number, money, date, datetime, select, multiselect, checkbox, user, location, file, url, phone, heading, note). Same format as returned by `processes.definitions.get`"
                                    },
                                    "flow": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Route: {\"steps\": [...]} with step types approval, task, review, condition, notify, set, watchers, finish. Conditions and timeout actions require the paid feature `processes_pro`"
                                    },
                                    "settings": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Who may submit (`submit`), available locations, default watchers, author cancel, route visibility"
                                    }
                                },
                                "required": [
                                    "name",
                                    "form",
                                    "flow",
                                    "settings"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "icon": "string",
                                "color": "string",
                                "form": [],
                                "flow": [],
                                "settings": []
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "flow": {
                                                    "type": "object",
                                                    "properties": {
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "approvers": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "kind": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    },
                                                                    "rule": {
                                                                        "type": "string"
                                                                    },
                                                                    "hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "submit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "watchers": {
                                                            "type": "array"
                                                        },
                                                        "author_cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "show_route": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "has_requests": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "status": "active",
                                        "version": 3,
                                        "has_unpublished_changes": false,
                                        "published_at": "2026-10-20T09:00:00+05:00",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "flow": {
                                            "steps": [
                                                {
                                                    "id": "s_approve",
                                                    "type": "approval",
                                                    "approvers": {
                                                        "kind": "manager"
                                                    },
                                                    "rule": "any",
                                                    "hours": 24
                                                }
                                            ]
                                        },
                                        "settings": {
                                            "submit": {
                                                "mode": "all"
                                            },
                                            "locations": null,
                                            "watchers": [],
                                            "author_cancel": true,
                                            "show_route": true
                                        },
                                        "errors": [],
                                        "has_requests": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}/duplicate": {
            "post": {
                "operationId": "processesDefinitionsDuplicate",
                "summary": "Duplicate a process",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_duplicate",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "flow": {
                                                    "type": "object",
                                                    "properties": {
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "approvers": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "kind": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    },
                                                                    "rule": {
                                                                        "type": "string"
                                                                    },
                                                                    "hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "submit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "watchers": {
                                                            "type": "array"
                                                        },
                                                        "author_cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "show_route": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "has_requests": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "status": "active",
                                        "version": 3,
                                        "has_unpublished_changes": false,
                                        "published_at": "2026-10-20T09:00:00+05:00",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "flow": {
                                            "steps": [
                                                {
                                                    "id": "s_approve",
                                                    "type": "approval",
                                                    "approvers": {
                                                        "kind": "manager"
                                                    },
                                                    "rule": "any",
                                                    "hours": 24
                                                }
                                            ]
                                        },
                                        "settings": {
                                            "submit": {
                                                "mode": "all"
                                            },
                                            "locations": null,
                                            "watchers": [],
                                            "author_cancel": true,
                                            "show_route": true
                                        },
                                        "errors": [],
                                        "has_requests": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}/publish": {
            "post": {
                "operationId": "processesDefinitionsPublish",
                "summary": "Publish a process",
                "description": "Validates and publishes the draft; new requests use the new version. Returns 422 with the list of problems if the definition is not valid.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_definitions_publish",
                "x-permissions": [
                    "processes.manage"
                ],
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "prefix": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "has_unpublished_changes": {
                                                    "type": "boolean"
                                                },
                                                "published_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "form": {
                                                    "type": "object",
                                                    "properties": {
                                                        "title": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "description": {
                                                            "type": "boolean"
                                                        },
                                                        "location": {
                                                            "type": "string"
                                                        },
                                                        "priority": {
                                                            "type": "string"
                                                        },
                                                        "priority_value": {
                                                            "type": "string"
                                                        },
                                                        "due": {
                                                            "type": "string"
                                                        },
                                                        "sla_hours": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fields": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "label": {
                                                                        "type": "string"
                                                                    },
                                                                    "required": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "photo": {
                                                                        "type": "boolean"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "flow": {
                                                    "type": "object",
                                                    "properties": {
                                                        "steps": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": {
                                                                        "type": "string"
                                                                    },
                                                                    "approvers": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "kind": {
                                                                                "type": "string"
                                                                            }
                                                                        }
                                                                    },
                                                                    "rule": {
                                                                        "type": "string"
                                                                    },
                                                                    "hours": {
                                                                        "type": "integer"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "submit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "mode": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "locations": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "watchers": {
                                                            "type": "array"
                                                        },
                                                        "author_cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "show_route": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "errors": {
                                                    "type": "array"
                                                },
                                                "has_requests": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "name": "Purchase request",
                                        "description": "Buying equipment and supplies",
                                        "icon": "shopping_cart",
                                        "color": "#5b54e8",
                                        "prefix": "BUY",
                                        "status": "active",
                                        "version": 3,
                                        "has_unpublished_changes": false,
                                        "published_at": "2026-10-20T09:00:00+05:00",
                                        "form": {
                                            "title": {
                                                "mode": "template",
                                                "template": "{process} {number}: {f_item}"
                                            },
                                            "description": true,
                                            "location": "required",
                                            "priority": "input",
                                            "priority_value": "medium",
                                            "due": "input",
                                            "sla_hours": null,
                                            "fields": [
                                                {
                                                    "id": "f_item",
                                                    "type": "text",
                                                    "label": "What to buy",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_sum",
                                                    "type": "money",
                                                    "label": "Amount",
                                                    "required": true
                                                },
                                                {
                                                    "id": "f_invoice",
                                                    "type": "file",
                                                    "label": "Invoice",
                                                    "required": false,
                                                    "photo": false
                                                }
                                            ]
                                        },
                                        "flow": {
                                            "steps": [
                                                {
                                                    "id": "s_approve",
                                                    "type": "approval",
                                                    "approvers": {
                                                        "kind": "manager"
                                                    },
                                                    "rule": "any",
                                                    "hours": 24
                                                }
                                            ]
                                        },
                                        "settings": {
                                            "submit": {
                                                "mode": "all"
                                            },
                                            "locations": null,
                                            "watchers": [],
                                            "author_cancel": true,
                                            "show_route": true
                                        },
                                        "errors": [],
                                        "has_requests": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}/requests": {
            "post": {
                "operationId": "processesRequestsCreate",
                "summary": "Submit a request",
                "description": "Creates a request (a task with an approval route) by the published form. `values` — answers by field id. Files for `file` fields: multipart `files[]` (in MCP — objects with `name` and `content_base64`) plus `file_fields[]` with the field id of each file; if the form has one file field, `file_fields` may be omitted. Repeating the call with the same `client_uuid` returns the same request.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_requests_create",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Title (when the form asks for it; otherwise generated by the template)",
                                        "maxLength": 512
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description (when the form has it)",
                                        "maxLength": 20000
                                    },
                                    "location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Location (required if the form says so)"
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Due date (when the form asks for it)"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "enum": [
                                            "urgent",
                                            "high",
                                            "medium",
                                            "low"
                                        ],
                                        "description": "Priority (when the form lets the author choose)"
                                    },
                                    "values": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Answers: {\"<field id>\": value}"
                                    },
                                    "watcher_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Additional watchers",
                                        "maxItems": 50
                                    },
                                    "files": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        },
                                        "description": "Files for `file` fields",
                                        "maxItems": 10
                                    },
                                    "file_fields": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Field id for each file in `files` (same order)",
                                        "maxItems": 10
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Idempotency key"
                                    }
                                }
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Title (when the form asks for it; otherwise generated by the template)",
                                        "maxLength": 512
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description (when the form has it)",
                                        "maxLength": 20000
                                    },
                                    "location_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Location (required if the form says so)"
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Due date (when the form asks for it)"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "enum": [
                                            "urgent",
                                            "high",
                                            "medium",
                                            "low"
                                        ],
                                        "description": "Priority (when the form lets the author choose)"
                                    },
                                    "values": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Answers: {\"<field id>\": value}"
                                    },
                                    "watcher_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Additional watchers",
                                        "maxItems": 50
                                    },
                                    "files": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "required": [
                                                "name",
                                                "content_base64"
                                            ],
                                            "properties": {
                                                "name": {
                                                    "type": "string",
                                                    "description": "File name with extension"
                                                },
                                                "content_base64": {
                                                    "type": "string",
                                                    "description": "File content, base64-encoded"
                                                }
                                            }
                                        },
                                        "description": "Files for `file` fields",
                                        "maxItems": 10
                                    },
                                    "file_fields": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Field id for each file in `files` (same order)",
                                        "maxItems": 10
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Idempotency key"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "author": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "process": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "icon": {
                                                            "type": "string"
                                                        },
                                                        "color": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "version": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "started_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "finished_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "values": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            },
                                                            "files": {
                                                                "type": "array"
                                                            }
                                                        }
                                                    }
                                                },
                                                "route": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "rule": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "overdue": {
                                                                "type": "boolean"
                                                            },
                                                            "people": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "user": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "id": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "uuid": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "name": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        },
                                                                        "decision": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "comment": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "decided_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "delegated_from": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "ahead": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "users": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "active_step": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "rule": {
                                                            "type": "string"
                                                        },
                                                        "mine": {
                                                            "type": "boolean"
                                                        },
                                                        "instructions": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "require_photo": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "can": {
                                                    "type": "object",
                                                    "properties": {
                                                        "decide": {
                                                            "type": "boolean"
                                                        },
                                                        "delegate": {
                                                            "type": "boolean"
                                                        },
                                                        "reject": {
                                                            "type": "boolean"
                                                        },
                                                        "comment_required": {
                                                            "type": "boolean"
                                                        },
                                                        "complete": {
                                                            "type": "boolean"
                                                        },
                                                        "resubmit": {
                                                            "type": "boolean"
                                                        },
                                                        "cancel": {
                                                            "type": "boolean"
                                                        },
                                                        "edit_values": {
                                                            "type": "boolean"
                                                        },
                                                        "override": {
                                                            "type": "boolean"
                                                        },
                                                        "move_to": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "override_steps": {
                                                    "type": "array"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "number": "BUY-42",
                                        "title": "Purchase request BUY-42: coffee grinder",
                                        "status": "approval",
                                        "author": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "location": {
                                            "id": 12,
                                            "name": "Abay Ave"
                                        },
                                        "process": {
                                            "id": 7,
                                            "name": "Purchase request",
                                            "icon": "shopping_cart",
                                            "color": "#5b54e8"
                                        },
                                        "version": 3,
                                        "state": "running",
                                        "started_at": "2026-11-03T10:00:00+05:00",
                                        "finished_at": null,
                                        "values": [
                                            {
                                                "id": "f_item",
                                                "label": "What to buy",
                                                "type": "text",
                                                "value": "Coffee grinder",
                                                "text": "Coffee grinder",
                                                "files": []
                                            },
                                            {
                                                "id": "f_invoice",
                                                "label": "Invoice",
                                                "type": "file",
                                                "value": [
                                                    77
                                                ],
                                                "text": "1",
                                                "files": [
                                                    {
                                                        "id": 77,
                                                        "name": "invoice.pdf",
                                                        "is_image": false,
                                                        "url": "https://app.jecheck.io/ui/tasks/files/77?signature=…"
                                                    }
                                                ]
                                            }
                                        ],
                                        "route": [
                                            {
                                                "id": 901,
                                                "key": "s_approve",
                                                "type": "approval",
                                                "name": "Manager approval",
                                                "state": "active",
                                                "rule": "any",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null,
                                                "due_at": "2026-11-04T10:00:00+05:00",
                                                "overdue": false,
                                                "people": [
                                                    {
                                                        "user": {
                                                            "id": 311,
                                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                            "name": "Aigerim Sadykova"
                                                        },
                                                        "decision": null,
                                                        "comment": null,
                                                        "decided_at": null,
                                                        "delegated_from": null
                                                    }
                                                ]
                                            }
                                        ],
                                        "ahead": [
                                            {
                                                "key": "s_buy",
                                                "type": "task",
                                                "name": "Purchase",
                                                "users": [
                                                    {
                                                        "id": 311,
                                                        "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                        "name": "Aigerim Sadykova"
                                                    }
                                                ]
                                            }
                                        ],
                                        "active_step": {
                                            "id": 901,
                                            "type": "approval",
                                            "name": "Manager approval",
                                            "rule": "any",
                                            "mine": true,
                                            "instructions": null,
                                            "require_photo": false
                                        },
                                        "can": {
                                            "decide": true,
                                            "delegate": true,
                                            "reject": true,
                                            "comment_required": true,
                                            "complete": false,
                                            "resubmit": false,
                                            "cancel": false,
                                            "edit_values": false,
                                            "override": false,
                                            "move_to": false
                                        },
                                        "override_steps": [],
                                        "url": "https://app.jecheck.io/ui/tasks?task=3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/processes/{id}/stats": {
            "get": {
                "operationId": "processesStats",
                "summary": "Get process analytics",
                "description": "Requests by state, durations (average and median), time per stage, slowest approvers, who has requests waiting, by location and by week, recent requests. Limited to the locations of `processes.reports`.",
                "tags": [
                    "Processes & requests"
                ],
                "x-mcp-tool": "processes_stats",
                "x-permissions": [
                    "processes.reports"
                ],
                "x-plan-feature": "processes_pro",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Process id",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "description": "Period, days",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                7,
                                30,
                                90,
                                365
                            ],
                            "default": 90
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "days": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "states": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "running": {
                                                            "type": "integer"
                                                        },
                                                        "rejected": {
                                                            "type": "integer"
                                                        }
                                                    }
                                                },
                                                "avg_minutes": {
                                                    "type": "integer"
                                                },
                                                "median_minutes": {
                                                    "type": "integer"
                                                },
                                                "overdue_steps": {
                                                    "type": "integer"
                                                },
                                                "rejected_share": {
                                                    "type": "integer"
                                                },
                                                "stages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "count": {
                                                                "type": "integer"
                                                            },
                                                            "avg_minutes": {
                                                                "type": "integer"
                                                            },
                                                            "late": {
                                                                "type": "integer"
                                                            },
                                                            "returned": {
                                                                "type": "integer"
                                                            },
                                                            "rejected": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "approvers": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "count": {
                                                                "type": "integer"
                                                            },
                                                            "avg_minutes": {
                                                                "type": "integer"
                                                            },
                                                            "rejected": {
                                                                "type": "integer"
                                                            },
                                                            "returned": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "waiting": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "count": {
                                                                "type": "integer"
                                                            },
                                                            "oldest": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        }
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "count": {
                                                                "type": "integer"
                                                            },
                                                            "open": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "weeks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "week": {
                                                                "type": "string"
                                                            },
                                                            "from": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "count": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "recent": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "location": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "author": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "started_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "finished_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "days": 90,
                                        "total": 120,
                                        "states": {
                                            "done": 100,
                                            "running": 12,
                                            "rejected": 8
                                        },
                                        "avg_minutes": 1440,
                                        "median_minutes": 900,
                                        "overdue_steps": 1,
                                        "rejected_share": 7,
                                        "stages": [
                                            {
                                                "key": "s_approve",
                                                "name": "Manager approval",
                                                "type": "approval",
                                                "count": 118,
                                                "avg_minutes": 300,
                                                "late": 4,
                                                "returned": 6,
                                                "rejected": 8
                                            }
                                        ],
                                        "approvers": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "count": 50,
                                                "avg_minutes": 420,
                                                "rejected": 3,
                                                "returned": 2
                                            }
                                        ],
                                        "waiting": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "count": 3,
                                                "oldest": "2026-11-01T09:00:00+05:00"
                                            }
                                        ],
                                        "locations": [
                                            {
                                                "location": {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                "count": 40,
                                                "open": 3
                                            }
                                        ],
                                        "weeks": [
                                            {
                                                "week": "2026-44",
                                                "from": "2026-10-26",
                                                "count": 9
                                            }
                                        ],
                                        "recent": [
                                            {
                                                "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                                "number": "BUY-42",
                                                "title": "Purchase request BUY-42: coffee grinder",
                                                "location": {
                                                    "id": 12,
                                                    "name": "Abay Ave"
                                                },
                                                "author": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "state": "running",
                                                "started_at": "2026-11-03T10:00:00+05:00",
                                                "finished_at": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles": {
            "get": {
                "operationId": "cyclesList",
                "summary": "List recurring projects",
                "description": "Recurring projects the token can see: all with `projects.cycles`, otherwise those it owns or is a member of, and those open to the company. Each has the latest period and its progress.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_list",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    },
                                                    "owner": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "schedule": {
                                                        "type": "object",
                                                        "properties": {
                                                            "frequency": {
                                                                "type": "string"
                                                            },
                                                            "anchor": {
                                                                "type": "string"
                                                            },
                                                            "day": {
                                                                "type": "integer"
                                                            },
                                                            "weekday": {
                                                                "type": "integer"
                                                            },
                                                            "create_offset": {
                                                                "type": "integer"
                                                            },
                                                            "hour": {
                                                                "type": "integer"
                                                            },
                                                            "holidays": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "schedule_text": {
                                                        "type": "string"
                                                    },
                                                    "next_run_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "last_period": {
                                                        "type": "string"
                                                    },
                                                    "items_count": {
                                                        "type": "integer"
                                                    },
                                                    "per_location_items": {
                                                        "type": "integer"
                                                    },
                                                    "location_ids": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "members": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "user": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "uuid": {
                                                                            "type": "string",
                                                                            "format": "uuid"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                },
                                                                "role": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "settings": {
                                                        "type": "object",
                                                        "properties": {
                                                            "visibility": {
                                                                "type": "string"
                                                            },
                                                            "notify_start": {
                                                                "type": "boolean"
                                                            },
                                                            "notify_unblocked": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    },
                                                    "role": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "template": {
                                                        "type": "object",
                                                        "properties": {
                                                            "sections": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "items": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "title": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string"
                                                                        },
                                                                        "section": {
                                                                            "type": "integer"
                                                                        },
                                                                        "per_location": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "assign": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "type": {
                                                                                    "type": "string"
                                                                                },
                                                                                "ids": {
                                                                                    "type": "array"
                                                                                }
                                                                            }
                                                                        },
                                                                        "start_offset": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "due_offset": {
                                                                            "type": "integer"
                                                                        },
                                                                        "priority": {
                                                                            "type": "string"
                                                                        },
                                                                        "requires_photo": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "requires_review": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "subtasks": {
                                                                            "type": "array"
                                                                        },
                                                                        "tags": {
                                                                            "type": "array"
                                                                        },
                                                                        "after": {
                                                                            "type": "array"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 7,
                                            "uuid": "4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                            "name": "Month-end closing",
                                            "description": "Documents, stocktaking, reconciliations and the owner report",
                                            "icon": "event_available",
                                            "color": "#0e9aa7",
                                            "key": "CLS",
                                            "active": true,
                                            "owner": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "schedule": {
                                                "frequency": "monthly",
                                                "anchor": "end",
                                                "day": 25,
                                                "weekday": 5,
                                                "create_offset": -5,
                                                "hour": 9,
                                                "holidays": [
                                                    "2026-12-16"
                                                ]
                                            },
                                            "schedule_text": "every month, by the last day; the project is created 5 working days before",
                                            "next_run_at": "2026-12-24T04:00:00+00:00",
                                            "last_period": "2026-11",
                                            "items_count": 13,
                                            "per_location_items": 6,
                                            "location_ids": null,
                                            "members": [
                                                {
                                                    "user": {
                                                        "id": 412,
                                                        "uuid": "2f3e4d5c-6b7a-4899-8a0b-2c3d4e5f6a7b",
                                                        "name": "Daniyar Ospanov"
                                                    },
                                                    "role": "viewer"
                                                }
                                            ],
                                            "settings": {
                                                "visibility": "members",
                                                "notify_start": true,
                                                "notify_unblocked": true
                                            },
                                            "role": "admin",
                                            "created_at": "2026-11-06T10:00:00+05:00",
                                            "updated_at": "2026-11-06T10:05:00+05:00",
                                            "url": "https://app.jecheck.io/ui/projects/cycles/4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                            "template": {
                                                "sections": [
                                                    "Location documents",
                                                    "Stocktaking"
                                                ],
                                                "items": [
                                                    {
                                                        "id": "i_k2m9qa",
                                                        "title": "All supplier invoices entered",
                                                        "description": "",
                                                        "section": 0,
                                                        "per_location": true,
                                                        "assign": {
                                                            "type": "manager",
                                                            "ids": []
                                                        },
                                                        "start_offset": null,
                                                        "due_offset": -1,
                                                        "priority": "medium",
                                                        "requires_photo": false,
                                                        "requires_review": false,
                                                        "subtasks": [],
                                                        "tags": [],
                                                        "after": []
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "cyclesCreate",
                "summary": "Create a recurring project",
                "description": "From a ready-made template, from the tasks of an existing project (`from_project_uuid`: sections, owners, dependencies, due dates as working days from the project due date) or blank. The first period is planned right away. Requires `projects.cycles`.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_create",
                "x-permissions": [
                    "projects.cycles"
                ],
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name; the period project is called «name · period»",
                                        "minLength": 2,
                                        "maxLength": 200
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "Key prefix of period projects (2–5 Latin letters/digits): `CLS` → `CLS2611`",
                                        "maxLength": 5
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Description",
                                        "maxLength": 20000
                                    },
                                    "icon": {
                                        "type": "string",
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color",
                                        "maxLength": 9
                                    },
                                    "schedule": {
                                        "type": "object",
                                        "properties": {
                                            "frequency": {
                                                "type": "string",
                                                "enum": [
                                                    "monthly",
                                                    "quarterly",
                                                    "weekly"
                                                ],
                                                "description": "How often"
                                            },
                                            "anchor": {
                                                "type": "string",
                                                "enum": [
                                                    "end",
                                                    "start",
                                                    "day"
                                                ],
                                                "description": "Anchor date of a month or quarter: last day, first day, or `day` of the month"
                                            },
                                            "day": {
                                                "type": "integer",
                                                "description": "Day of the month for `anchor: day`",
                                                "minimum": 1,
                                                "maximum": 31
                                            },
                                            "weekday": {
                                                "type": "integer",
                                                "description": "Weekly: anchor weekday, 1 = Monday",
                                                "minimum": 1,
                                                "maximum": 7
                                            },
                                            "create_offset": {
                                                "type": "integer",
                                                "description": "When to create the period project: working days from the anchor date",
                                                "minimum": -60,
                                                "maximum": 20
                                            },
                                            "hour": {
                                                "type": "integer",
                                                "description": "Hour of creation, company local time",
                                                "minimum": 0,
                                                "maximum": 23
                                            },
                                            "holidays": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                },
                                                "description": "Company days off (YYYY-MM-DD) skipped in working-day offsets in addition to weekends"
                                            }
                                        },
                                        "description": "Schedule"
                                    },
                                    "template_sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Sections of the template"
                                    },
                                    "template_items": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Stable item id (`i_` + letters/digits); generated if omitted. Used by `after` and as the summary row"
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "description": "Item title — the task title",
                                                    "maxLength": 512
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "description": "Task description",
                                                    "maxLength": 20000
                                                },
                                                "section": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Section index in `template_sections`"
                                                },
                                                "per_location": {
                                                    "type": "boolean",
                                                    "description": "Create a separate task for every location of the recurring project"
                                                },
                                                "assign": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string",
                                                            "enum": [
                                                                "none",
                                                                "users",
                                                                "team",
                                                                "position",
                                                                "manager",
                                                                "owner"
                                                            ],
                                                            "description": "`users` — the listed people; `team` — a team queue; `position` — employees with the position at the task location; `manager` — the location manager; `owner` — the recurring project owner"
                                                        },
                                                        "ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            },
                                                            "description": "User, team or position ids"
                                                        }
                                                    },
                                                    "description": "Who gets the task"
                                                },
                                                "start_offset": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Start: working days from the anchor date (negative — before)"
                                                },
                                                "due_offset": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Due date: working days from the anchor date (−2 — two working days before; 3 — three after)"
                                                },
                                                "priority": {
                                                    "type": "string",
                                                    "enum": [
                                                        "urgent",
                                                        "high",
                                                        "medium",
                                                        "low"
                                                    ],
                                                    "description": "Task priority"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean",
                                                    "description": "A photo is required to complete the task"
                                                },
                                                "requires_review": {
                                                    "type": "boolean",
                                                    "description": "The task goes to review before it is done"
                                                },
                                                "subtasks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "description": "Checklist inside the task"
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "description": "Tags"
                                                },
                                                "after": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "description": "Ids of items that must be done first; for items per location the dependency links tasks of the same location"
                                                }
                                            },
                                            "required": [
                                                "title"
                                            ]
                                        },
                                        "description": "Template items (replaces the whole list)",
                                        "maxItems": 200
                                    },
                                    "location_ids": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Locations for items per location; null — all locations of the company"
                                    },
                                    "owner_id": {
                                        "type": "integer",
                                        "description": "Owner: admin of period projects, author of tasks"
                                    },
                                    "members": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer",
                                                    "description": "User id"
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "enum": [
                                                        "admin",
                                                        "editor",
                                                        "commenter",
                                                        "viewer"
                                                    ],
                                                    "description": "Role in period projects; `admin` also configures the recurring project"
                                                }
                                            },
                                            "required": [
                                                "user_id"
                                            ]
                                        },
                                        "description": "Members (replaces the list)",
                                        "maxItems": 200
                                    },
                                    "settings": {
                                        "type": "object",
                                        "properties": {
                                            "visibility": {
                                                "type": "string",
                                                "enum": [
                                                    "members",
                                                    "company"
                                                ],
                                                "description": "Visibility of period projects"
                                            },
                                            "notify_start": {
                                                "type": "boolean",
                                                "description": "Send each owner one message when a period starts"
                                            },
                                            "notify_unblocked": {
                                                "type": "boolean",
                                                "description": "Notify assignees when the previous step is done"
                                            }
                                        },
                                        "description": "Settings"
                                    },
                                    "active": {
                                        "type": "boolean",
                                        "description": "Create periods on schedule"
                                    },
                                    "template": {
                                        "type": "string",
                                        "description": "Ready-made template id (see `cycles.templates`)",
                                        "maxLength": 40
                                    },
                                    "from_project_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Build the template from this project's tasks"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "key": "string",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "icon": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "schedule": {
                                                    "type": "object",
                                                    "properties": {
                                                        "frequency": {
                                                            "type": "string"
                                                        },
                                                        "anchor": {
                                                            "type": "string"
                                                        },
                                                        "day": {
                                                            "type": "integer"
                                                        },
                                                        "weekday": {
                                                            "type": "integer"
                                                        },
                                                        "create_offset": {
                                                            "type": "integer"
                                                        },
                                                        "hour": {
                                                            "type": "integer"
                                                        },
                                                        "holidays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "schedule_text": {
                                                    "type": "string"
                                                },
                                                "next_run_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "last_period": {
                                                    "type": "string"
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "per_location_items": {
                                                    "type": "integer"
                                                },
                                                "location_ids": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "visibility": {
                                                            "type": "string"
                                                        },
                                                        "notify_start": {
                                                            "type": "boolean"
                                                        },
                                                        "notify_unblocked": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "template": {
                                                    "type": "object",
                                                    "properties": {
                                                        "sections": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "items": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "description": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "integer"
                                                                    },
                                                                    "per_location": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "assign": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "type": {
                                                                                "type": "string"
                                                                            },
                                                                            "ids": {
                                                                                "type": "array"
                                                                            }
                                                                        }
                                                                    },
                                                                    "start_offset": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "due_offset": {
                                                                        "type": "integer"
                                                                    },
                                                                    "priority": {
                                                                        "type": "string"
                                                                    },
                                                                    "requires_photo": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "requires_review": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "subtasks": {
                                                                        "type": "array"
                                                                    },
                                                                    "tags": {
                                                                        "type": "array"
                                                                    },
                                                                    "after": {
                                                                        "type": "array"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "uuid": "4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "name": "Month-end closing",
                                        "description": "Documents, stocktaking, reconciliations and the owner report",
                                        "icon": "event_available",
                                        "color": "#0e9aa7",
                                        "key": "CLS",
                                        "active": true,
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "schedule": {
                                            "frequency": "monthly",
                                            "anchor": "end",
                                            "day": 25,
                                            "weekday": 5,
                                            "create_offset": -5,
                                            "hour": 9,
                                            "holidays": [
                                                "2026-12-16"
                                            ]
                                        },
                                        "schedule_text": "every month, by the last day; the project is created 5 working days before",
                                        "next_run_at": "2026-12-24T04:00:00+00:00",
                                        "last_period": "2026-11",
                                        "items_count": 13,
                                        "per_location_items": 6,
                                        "location_ids": null,
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 412,
                                                    "uuid": "2f3e4d5c-6b7a-4899-8a0b-2c3d4e5f6a7b",
                                                    "name": "Daniyar Ospanov"
                                                },
                                                "role": "viewer"
                                            }
                                        ],
                                        "settings": {
                                            "visibility": "members",
                                            "notify_start": true,
                                            "notify_unblocked": true
                                        },
                                        "role": "admin",
                                        "created_at": "2026-11-06T10:00:00+05:00",
                                        "updated_at": "2026-11-06T10:05:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/cycles/4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "template": {
                                            "sections": [
                                                "Location documents",
                                                "Stocktaking"
                                            ],
                                            "items": [
                                                {
                                                    "id": "i_k2m9qa",
                                                    "title": "All supplier invoices entered",
                                                    "description": "",
                                                    "section": 0,
                                                    "per_location": true,
                                                    "assign": {
                                                        "type": "manager",
                                                        "ids": []
                                                    },
                                                    "start_offset": null,
                                                    "due_offset": -1,
                                                    "priority": "medium",
                                                    "requires_photo": false,
                                                    "requires_review": false,
                                                    "subtasks": [],
                                                    "tags": [],
                                                    "after": []
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/periods/{uuid}/shift": {
            "post": {
                "operationId": "cyclesShift",
                "summary": "Shift due dates",
                "description": "Moves due dates and start dates of open tasks by `days` working days (weekends and company days off are skipped). `task_uuids` — which tasks (empty — all open); `cascade` — together with the tasks that depend on them down the chain. Each change is recorded in the task history; assignees get one notification. Requires the editor role in the period project.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_shift",
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "UUID of a period project (a project created by a recurring project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "days": {
                                        "type": "integer",
                                        "description": "Working days; negative — earlier",
                                        "minimum": -60,
                                        "maximum": 60
                                    },
                                    "task_uuids": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Tasks to shift; empty — all open tasks of the period",
                                        "maxItems": 500
                                    },
                                    "cascade": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Also shift dependent tasks"
                                    },
                                    "reason": {
                                        "type": "string",
                                        "description": "Reason, saved in the task history",
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "days"
                                ]
                            },
                            "example": {
                                "days": 42,
                                "task_uuids": [
                                    "example"
                                ],
                                "cascade": true,
                                "reason": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "moved": {
                                                    "type": "integer"
                                                },
                                                "tasks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "moved": 6,
                                        "tasks": [
                                            "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b"
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/periods/{uuid}/summary": {
            "get": {
                "operationId": "cyclesSummary",
                "summary": "Period summary",
                "description": "The summary matrix of a period project: rows — template items, columns — locations (`cells` by location id; items not per location are in `general`). Cell `state`: done, done_late, overdue, blocked (waits for another task), review, in_progress, todo, planned (starts later). Also readiness by location, team, person and section, delays (overdue tasks and the number of open tasks waiting for them down the chain), plan/fact chart by day and a finish forecast. Requires access to the period project.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_summary",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "UUID of a period project (a project created by a recurring project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "project": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "period": {
                                                            "type": "string"
                                                        },
                                                        "anchor": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "start": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "cycle": {
                                                    "type": "object",
                                                    "properties": {
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "today": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "rows": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "section": {
                                                                "type": "integer"
                                                            },
                                                            "per_location": {
                                                                "type": "boolean"
                                                            },
                                                            "extra": {
                                                                "type": "boolean"
                                                            },
                                                            "cells": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "12": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "key": {
                                                                                    "type": "string",
                                                                                    "format": "uuid"
                                                                                },
                                                                                "seq": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "title": {
                                                                                    "type": "string"
                                                                                },
                                                                                "state": {
                                                                                    "type": "string"
                                                                                },
                                                                                "open": {
                                                                                    "type": "boolean"
                                                                                },
                                                                                "status": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "due": {
                                                                                    "type": "string",
                                                                                    "format": "date"
                                                                                },
                                                                                "start": {
                                                                                    "type": [
                                                                                        "string",
                                                                                        "null"
                                                                                    ]
                                                                                },
                                                                                "done_at": {
                                                                                    "type": [
                                                                                        "string",
                                                                                        "null"
                                                                                    ]
                                                                                },
                                                                                "late": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "blockers": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "assignees": {
                                                                                    "type": "array",
                                                                                    "items": {
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "team": {
                                                                                    "type": [
                                                                                        "string",
                                                                                        "null"
                                                                                    ]
                                                                                },
                                                                                "location": {
                                                                                    "type": "string"
                                                                                },
                                                                                "section": {
                                                                                    "type": "integer"
                                                                                },
                                                                                "item": {
                                                                                    "type": "string"
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "general": {
                                                                "type": "array"
                                                            },
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "progress": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "due": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "totals": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "progress": {
                                                            "type": "integer"
                                                        },
                                                        "plan": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "blocked": {
                                                            "type": "integer"
                                                        },
                                                        "done_late": {
                                                            "type": "integer"
                                                        },
                                                        "unassigned": {
                                                            "type": "integer"
                                                        },
                                                        "states": {
                                                            "type": "object",
                                                            "properties": {
                                                                "overdue": {
                                                                    "type": "integer"
                                                                },
                                                                "done": {
                                                                    "type": "integer"
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "by_location": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "done_late": {
                                                                "type": "integer"
                                                            },
                                                            "blocked": {
                                                                "type": "integer"
                                                            },
                                                            "late_days": {
                                                                "type": "integer"
                                                            },
                                                            "progress": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "by_team": {
                                                    "type": "array"
                                                },
                                                "by_person": {
                                                    "type": "array"
                                                },
                                                "by_section": {
                                                    "type": "array"
                                                },
                                                "delays": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "seq": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "open": {
                                                                "type": "boolean"
                                                            },
                                                            "status": {
                                                                "type": "integer"
                                                            },
                                                            "due": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "start": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "done_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "late": {
                                                                "type": "integer"
                                                            },
                                                            "blockers": {
                                                                "type": "integer"
                                                            },
                                                            "assignees": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "team": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "location": {
                                                                "type": "string"
                                                            },
                                                            "section": {
                                                                "type": "integer"
                                                            },
                                                            "item": {
                                                                "type": "string"
                                                            },
                                                            "downstream": {
                                                                "type": "integer"
                                                            },
                                                            "waiting": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "chart": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "plan": {
                                                                "type": "integer"
                                                            },
                                                            "fact": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "forecast": {
                                                    "type": "object",
                                                    "properties": {
                                                        "done": {
                                                            "type": "boolean"
                                                        },
                                                        "date": {
                                                            "type": "string",
                                                            "format": "date"
                                                        },
                                                        "late": {
                                                            "type": "integer"
                                                        },
                                                        "left": {
                                                            "type": "integer"
                                                        },
                                                        "pace": {
                                                            "type": "number"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "project": {
                                            "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "CLS2611",
                                            "name": "Month-end closing · November 2026",
                                            "period": "2026-11",
                                            "anchor": "2026-11-30",
                                            "start": "2026-11-23",
                                            "status": "active"
                                        },
                                        "cycle": {
                                            "uuid": "4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                            "name": "Month-end closing"
                                        },
                                        "today": "2026-11-30",
                                        "sections": [
                                            "Location documents"
                                        ],
                                        "locations": [
                                            {
                                                "id": "12",
                                                "name": "Abay 10"
                                            }
                                        ],
                                        "rows": [
                                            {
                                                "id": "i_k2m9qa",
                                                "title": "All supplier invoices entered",
                                                "section": 0,
                                                "per_location": true,
                                                "extra": false,
                                                "cells": {
                                                    "12": [
                                                        {
                                                            "key": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                                            "seq": 1,
                                                            "title": "All supplier invoices entered",
                                                            "state": "overdue",
                                                            "open": true,
                                                            "status": 0,
                                                            "due": "2026-11-27",
                                                            "start": null,
                                                            "done_at": null,
                                                            "late": 1,
                                                            "blockers": 0,
                                                            "assignees": [
                                                                "311"
                                                            ],
                                                            "team": null,
                                                            "location": "12",
                                                            "section": 201,
                                                            "item": "i_k2m9qa"
                                                        }
                                                    ]
                                                },
                                                "general": [],
                                                "total": 2,
                                                "done": 1,
                                                "progress": 50,
                                                "overdue": 1,
                                                "due": "2026-11-27"
                                            }
                                        ],
                                        "totals": {
                                            "total": 19,
                                            "done": 4,
                                            "progress": 21,
                                            "plan": 37,
                                            "overdue": 3,
                                            "blocked": 6,
                                            "done_late": 1,
                                            "unassigned": 2,
                                            "states": {
                                                "overdue": 3,
                                                "done": 3
                                            }
                                        },
                                        "by_location": [
                                            {
                                                "id": "12",
                                                "total": 9,
                                                "done": 2,
                                                "overdue": 2,
                                                "done_late": 0,
                                                "blocked": 4,
                                                "late_days": 3,
                                                "progress": 22
                                            }
                                        ],
                                        "by_team": [],
                                        "by_person": [],
                                        "by_section": [],
                                        "delays": [
                                            {
                                                "key": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                                "seq": 1,
                                                "title": "All supplier invoices entered",
                                                "state": "overdue",
                                                "open": true,
                                                "status": 0,
                                                "due": "2026-11-27",
                                                "start": null,
                                                "done_at": null,
                                                "late": 1,
                                                "blockers": 0,
                                                "assignees": [
                                                    "311"
                                                ],
                                                "team": null,
                                                "location": "12",
                                                "section": 201,
                                                "item": "i_k2m9qa",
                                                "downstream": 7,
                                                "waiting": 2
                                            }
                                        ],
                                        "chart": [
                                            {
                                                "date": "2026-11-23",
                                                "plan": 0,
                                                "fact": 0
                                            }
                                        ],
                                        "forecast": {
                                            "done": false,
                                            "date": "2026-12-08",
                                            "late": 2,
                                            "left": 15,
                                            "pace": 1.6
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/templates": {
            "get": {
                "operationId": "cyclesTemplates",
                "summary": "List ready-made templates",
                "description": "Built-in recurring project templates (month-end closing, stocktaking, quarter closing, blank). Pass the `id` as `template` when creating.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_templates",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "items": {
                                                        "type": "integer"
                                                    },
                                                    "frequency": {
                                                        "type": "string"
                                                    },
                                                    "per_location_items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": "month_close",
                                            "name": "Month-end closing",
                                            "description": "Documents, stocktaking, reconciliations…",
                                            "icon": "event_available",
                                            "items": 13,
                                            "frequency": "monthly",
                                            "per_location_items": 6
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}": {
            "get": {
                "operationId": "cyclesGet",
                "summary": "Retrieve a recurring project",
                "description": "Card, schedule and the full template (sections and items).",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_get",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "schedule": {
                                                    "type": "object",
                                                    "properties": {
                                                        "frequency": {
                                                            "type": "string"
                                                        },
                                                        "anchor": {
                                                            "type": "string"
                                                        },
                                                        "day": {
                                                            "type": "integer"
                                                        },
                                                        "weekday": {
                                                            "type": "integer"
                                                        },
                                                        "create_offset": {
                                                            "type": "integer"
                                                        },
                                                        "hour": {
                                                            "type": "integer"
                                                        },
                                                        "holidays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "schedule_text": {
                                                    "type": "string"
                                                },
                                                "next_run_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "last_period": {
                                                    "type": "string"
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "per_location_items": {
                                                    "type": "integer"
                                                },
                                                "location_ids": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "visibility": {
                                                            "type": "string"
                                                        },
                                                        "notify_start": {
                                                            "type": "boolean"
                                                        },
                                                        "notify_unblocked": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "template": {
                                                    "type": "object",
                                                    "properties": {
                                                        "sections": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "items": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "description": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "integer"
                                                                    },
                                                                    "per_location": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "assign": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "type": {
                                                                                "type": "string"
                                                                            },
                                                                            "ids": {
                                                                                "type": "array"
                                                                            }
                                                                        }
                                                                    },
                                                                    "start_offset": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "due_offset": {
                                                                        "type": "integer"
                                                                    },
                                                                    "priority": {
                                                                        "type": "string"
                                                                    },
                                                                    "requires_photo": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "requires_review": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "subtasks": {
                                                                        "type": "array"
                                                                    },
                                                                    "tags": {
                                                                        "type": "array"
                                                                    },
                                                                    "after": {
                                                                        "type": "array"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "uuid": "4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "name": "Month-end closing",
                                        "description": "Documents, stocktaking, reconciliations and the owner report",
                                        "icon": "event_available",
                                        "color": "#0e9aa7",
                                        "key": "CLS",
                                        "active": true,
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "schedule": {
                                            "frequency": "monthly",
                                            "anchor": "end",
                                            "day": 25,
                                            "weekday": 5,
                                            "create_offset": -5,
                                            "hour": 9,
                                            "holidays": [
                                                "2026-12-16"
                                            ]
                                        },
                                        "schedule_text": "every month, by the last day; the project is created 5 working days before",
                                        "next_run_at": "2026-12-24T04:00:00+00:00",
                                        "last_period": "2026-11",
                                        "items_count": 13,
                                        "per_location_items": 6,
                                        "location_ids": null,
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 412,
                                                    "uuid": "2f3e4d5c-6b7a-4899-8a0b-2c3d4e5f6a7b",
                                                    "name": "Daniyar Ospanov"
                                                },
                                                "role": "viewer"
                                            }
                                        ],
                                        "settings": {
                                            "visibility": "members",
                                            "notify_start": true,
                                            "notify_unblocked": true
                                        },
                                        "role": "admin",
                                        "created_at": "2026-11-06T10:00:00+05:00",
                                        "updated_at": "2026-11-06T10:05:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/cycles/4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "template": {
                                            "sections": [
                                                "Location documents",
                                                "Stocktaking"
                                            ],
                                            "items": [
                                                {
                                                    "id": "i_k2m9qa",
                                                    "title": "All supplier invoices entered",
                                                    "description": "",
                                                    "section": 0,
                                                    "per_location": true,
                                                    "assign": {
                                                        "type": "manager",
                                                        "ids": []
                                                    },
                                                    "start_offset": null,
                                                    "due_offset": -1,
                                                    "priority": "medium",
                                                    "requires_photo": false,
                                                    "requires_review": false,
                                                    "subtasks": [],
                                                    "tags": [],
                                                    "after": []
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "cyclesUpdate",
                "summary": "Update a recurring project",
                "description": "Partial update. Template changes apply to the next periods; existing period projects are not changed. Requires the admin role in the recurring project.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_update",
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name; the period project is called «name · period»",
                                        "minLength": 2,
                                        "maxLength": 200
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "Key prefix of period projects (2–5 Latin letters/digits): `CLS` → `CLS2611`",
                                        "maxLength": 5
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Description",
                                        "maxLength": 20000
                                    },
                                    "icon": {
                                        "type": "string",
                                        "description": "Material Symbols icon name",
                                        "maxLength": 40
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color",
                                        "maxLength": 9
                                    },
                                    "schedule": {
                                        "type": "object",
                                        "properties": {
                                            "frequency": {
                                                "type": "string",
                                                "enum": [
                                                    "monthly",
                                                    "quarterly",
                                                    "weekly"
                                                ],
                                                "description": "How often"
                                            },
                                            "anchor": {
                                                "type": "string",
                                                "enum": [
                                                    "end",
                                                    "start",
                                                    "day"
                                                ],
                                                "description": "Anchor date of a month or quarter: last day, first day, or `day` of the month"
                                            },
                                            "day": {
                                                "type": "integer",
                                                "description": "Day of the month for `anchor: day`",
                                                "minimum": 1,
                                                "maximum": 31
                                            },
                                            "weekday": {
                                                "type": "integer",
                                                "description": "Weekly: anchor weekday, 1 = Monday",
                                                "minimum": 1,
                                                "maximum": 7
                                            },
                                            "create_offset": {
                                                "type": "integer",
                                                "description": "When to create the period project: working days from the anchor date",
                                                "minimum": -60,
                                                "maximum": 20
                                            },
                                            "hour": {
                                                "type": "integer",
                                                "description": "Hour of creation, company local time",
                                                "minimum": 0,
                                                "maximum": 23
                                            },
                                            "holidays": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                },
                                                "description": "Company days off (YYYY-MM-DD) skipped in working-day offsets in addition to weekends"
                                            }
                                        },
                                        "description": "Schedule"
                                    },
                                    "template_sections": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Sections of the template"
                                    },
                                    "template_items": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "description": "Stable item id (`i_` + letters/digits); generated if omitted. Used by `after` and as the summary row"
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "description": "Item title — the task title",
                                                    "maxLength": 512
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "description": "Task description",
                                                    "maxLength": 20000
                                                },
                                                "section": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Section index in `template_sections`"
                                                },
                                                "per_location": {
                                                    "type": "boolean",
                                                    "description": "Create a separate task for every location of the recurring project"
                                                },
                                                "assign": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string",
                                                            "enum": [
                                                                "none",
                                                                "users",
                                                                "team",
                                                                "position",
                                                                "manager",
                                                                "owner"
                                                            ],
                                                            "description": "`users` — the listed people; `team` — a team queue; `position` — employees with the position at the task location; `manager` — the location manager; `owner` — the recurring project owner"
                                                        },
                                                        "ids": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            },
                                                            "description": "User, team or position ids"
                                                        }
                                                    },
                                                    "description": "Who gets the task"
                                                },
                                                "start_offset": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Start: working days from the anchor date (negative — before)"
                                                },
                                                "due_offset": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Due date: working days from the anchor date (−2 — two working days before; 3 — three after)"
                                                },
                                                "priority": {
                                                    "type": "string",
                                                    "enum": [
                                                        "urgent",
                                                        "high",
                                                        "medium",
                                                        "low"
                                                    ],
                                                    "description": "Task priority"
                                                },
                                                "requires_photo": {
                                                    "type": "boolean",
                                                    "description": "A photo is required to complete the task"
                                                },
                                                "requires_review": {
                                                    "type": "boolean",
                                                    "description": "The task goes to review before it is done"
                                                },
                                                "subtasks": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "description": "Checklist inside the task"
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "description": "Tags"
                                                },
                                                "after": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "description": "Ids of items that must be done first; for items per location the dependency links tasks of the same location"
                                                }
                                            },
                                            "required": [
                                                "title"
                                            ]
                                        },
                                        "description": "Template items (replaces the whole list)",
                                        "maxItems": 200
                                    },
                                    "location_ids": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Locations for items per location; null — all locations of the company"
                                    },
                                    "owner_id": {
                                        "type": "integer",
                                        "description": "Owner: admin of period projects, author of tasks"
                                    },
                                    "members": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer",
                                                    "description": "User id"
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "enum": [
                                                        "admin",
                                                        "editor",
                                                        "commenter",
                                                        "viewer"
                                                    ],
                                                    "description": "Role in period projects; `admin` also configures the recurring project"
                                                }
                                            },
                                            "required": [
                                                "user_id"
                                            ]
                                        },
                                        "description": "Members (replaces the list)",
                                        "maxItems": 200
                                    },
                                    "settings": {
                                        "type": "object",
                                        "properties": {
                                            "visibility": {
                                                "type": "string",
                                                "enum": [
                                                    "members",
                                                    "company"
                                                ],
                                                "description": "Visibility of period projects"
                                            },
                                            "notify_start": {
                                                "type": "boolean",
                                                "description": "Send each owner one message when a period starts"
                                            },
                                            "notify_unblocked": {
                                                "type": "boolean",
                                                "description": "Notify assignees when the previous step is done"
                                            }
                                        },
                                        "description": "Settings"
                                    },
                                    "active": {
                                        "type": "boolean",
                                        "description": "Create periods on schedule"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "key": "string",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "icon": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "schedule": {
                                                    "type": "object",
                                                    "properties": {
                                                        "frequency": {
                                                            "type": "string"
                                                        },
                                                        "anchor": {
                                                            "type": "string"
                                                        },
                                                        "day": {
                                                            "type": "integer"
                                                        },
                                                        "weekday": {
                                                            "type": "integer"
                                                        },
                                                        "create_offset": {
                                                            "type": "integer"
                                                        },
                                                        "hour": {
                                                            "type": "integer"
                                                        },
                                                        "holidays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "schedule_text": {
                                                    "type": "string"
                                                },
                                                "next_run_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "last_period": {
                                                    "type": "string"
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "per_location_items": {
                                                    "type": "integer"
                                                },
                                                "location_ids": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "visibility": {
                                                            "type": "string"
                                                        },
                                                        "notify_start": {
                                                            "type": "boolean"
                                                        },
                                                        "notify_unblocked": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "template": {
                                                    "type": "object",
                                                    "properties": {
                                                        "sections": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "items": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "description": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "integer"
                                                                    },
                                                                    "per_location": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "assign": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "type": {
                                                                                "type": "string"
                                                                            },
                                                                            "ids": {
                                                                                "type": "array"
                                                                            }
                                                                        }
                                                                    },
                                                                    "start_offset": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "due_offset": {
                                                                        "type": "integer"
                                                                    },
                                                                    "priority": {
                                                                        "type": "string"
                                                                    },
                                                                    "requires_photo": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "requires_review": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "subtasks": {
                                                                        "type": "array"
                                                                    },
                                                                    "tags": {
                                                                        "type": "array"
                                                                    },
                                                                    "after": {
                                                                        "type": "array"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "uuid": "4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "name": "Month-end closing",
                                        "description": "Documents, stocktaking, reconciliations and the owner report",
                                        "icon": "event_available",
                                        "color": "#0e9aa7",
                                        "key": "CLS",
                                        "active": true,
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "schedule": {
                                            "frequency": "monthly",
                                            "anchor": "end",
                                            "day": 25,
                                            "weekday": 5,
                                            "create_offset": -5,
                                            "hour": 9,
                                            "holidays": [
                                                "2026-12-16"
                                            ]
                                        },
                                        "schedule_text": "every month, by the last day; the project is created 5 working days before",
                                        "next_run_at": "2026-12-24T04:00:00+00:00",
                                        "last_period": "2026-11",
                                        "items_count": 13,
                                        "per_location_items": 6,
                                        "location_ids": null,
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 412,
                                                    "uuid": "2f3e4d5c-6b7a-4899-8a0b-2c3d4e5f6a7b",
                                                    "name": "Daniyar Ospanov"
                                                },
                                                "role": "viewer"
                                            }
                                        ],
                                        "settings": {
                                            "visibility": "members",
                                            "notify_start": true,
                                            "notify_unblocked": true
                                        },
                                        "role": "admin",
                                        "created_at": "2026-11-06T10:00:00+05:00",
                                        "updated_at": "2026-11-06T10:05:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/cycles/4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "template": {
                                            "sections": [
                                                "Location documents",
                                                "Stocktaking"
                                            ],
                                            "items": [
                                                {
                                                    "id": "i_k2m9qa",
                                                    "title": "All supplier invoices entered",
                                                    "description": "",
                                                    "section": 0,
                                                    "per_location": true,
                                                    "assign": {
                                                        "type": "manager",
                                                        "ids": []
                                                    },
                                                    "start_offset": null,
                                                    "due_offset": -1,
                                                    "priority": "medium",
                                                    "requires_photo": false,
                                                    "requires_review": false,
                                                    "subtasks": [],
                                                    "tags": [],
                                                    "after": []
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "cyclesDelete",
                "summary": "Delete a recurring project",
                "description": "Stops creating periods and removes the recurring project. Period projects already created stay as regular projects.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_delete",
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}/duplicate": {
            "post": {
                "operationId": "cyclesDuplicate",
                "summary": "Duplicate a recurring project",
                "description": "Copy of the template and schedule, paused, without periods. Requires `projects.cycles`.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_duplicate",
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the copy",
                                        "minLength": 2,
                                        "maxLength": 200
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "schedule": {
                                                    "type": "object",
                                                    "properties": {
                                                        "frequency": {
                                                            "type": "string"
                                                        },
                                                        "anchor": {
                                                            "type": "string"
                                                        },
                                                        "day": {
                                                            "type": "integer"
                                                        },
                                                        "weekday": {
                                                            "type": "integer"
                                                        },
                                                        "create_offset": {
                                                            "type": "integer"
                                                        },
                                                        "hour": {
                                                            "type": "integer"
                                                        },
                                                        "holidays": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string",
                                                                "format": "date"
                                                            }
                                                        }
                                                    }
                                                },
                                                "schedule_text": {
                                                    "type": "string"
                                                },
                                                "next_run_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "last_period": {
                                                    "type": "string"
                                                },
                                                "items_count": {
                                                    "type": "integer"
                                                },
                                                "per_location_items": {
                                                    "type": "integer"
                                                },
                                                "location_ids": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "visibility": {
                                                            "type": "string"
                                                        },
                                                        "notify_start": {
                                                            "type": "boolean"
                                                        },
                                                        "notify_unblocked": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "template": {
                                                    "type": "object",
                                                    "properties": {
                                                        "sections": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "items": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "description": {
                                                                        "type": "string"
                                                                    },
                                                                    "section": {
                                                                        "type": "integer"
                                                                    },
                                                                    "per_location": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "assign": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "type": {
                                                                                "type": "string"
                                                                            },
                                                                            "ids": {
                                                                                "type": "array"
                                                                            }
                                                                        }
                                                                    },
                                                                    "start_offset": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "due_offset": {
                                                                        "type": "integer"
                                                                    },
                                                                    "priority": {
                                                                        "type": "string"
                                                                    },
                                                                    "requires_photo": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "requires_review": {
                                                                        "type": "boolean"
                                                                    },
                                                                    "subtasks": {
                                                                        "type": "array"
                                                                    },
                                                                    "tags": {
                                                                        "type": "array"
                                                                    },
                                                                    "after": {
                                                                        "type": "array"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 7,
                                        "uuid": "4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "name": "Month-end closing",
                                        "description": "Documents, stocktaking, reconciliations and the owner report",
                                        "icon": "event_available",
                                        "color": "#0e9aa7",
                                        "key": "CLS",
                                        "active": true,
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "schedule": {
                                            "frequency": "monthly",
                                            "anchor": "end",
                                            "day": 25,
                                            "weekday": 5,
                                            "create_offset": -5,
                                            "hour": 9,
                                            "holidays": [
                                                "2026-12-16"
                                            ]
                                        },
                                        "schedule_text": "every month, by the last day; the project is created 5 working days before",
                                        "next_run_at": "2026-12-24T04:00:00+00:00",
                                        "last_period": "2026-11",
                                        "items_count": 13,
                                        "per_location_items": 6,
                                        "location_ids": null,
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 412,
                                                    "uuid": "2f3e4d5c-6b7a-4899-8a0b-2c3d4e5f6a7b",
                                                    "name": "Daniyar Ospanov"
                                                },
                                                "role": "viewer"
                                            }
                                        ],
                                        "settings": {
                                            "visibility": "members",
                                            "notify_start": true,
                                            "notify_unblocked": true
                                        },
                                        "role": "admin",
                                        "created_at": "2026-11-06T10:00:00+05:00",
                                        "updated_at": "2026-11-06T10:05:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/cycles/4b0e6c2a-1d3f-4a5b-9c8d-7e6f5a4b3c2d",
                                        "template": {
                                            "sections": [
                                                "Location documents",
                                                "Stocktaking"
                                            ],
                                            "items": [
                                                {
                                                    "id": "i_k2m9qa",
                                                    "title": "All supplier invoices entered",
                                                    "description": "",
                                                    "section": 0,
                                                    "per_location": true,
                                                    "assign": {
                                                        "type": "manager",
                                                        "ids": []
                                                    },
                                                    "start_offset": null,
                                                    "due_offset": -1,
                                                    "priority": "medium",
                                                    "requires_photo": false,
                                                    "requires_review": false,
                                                    "subtasks": [],
                                                    "tags": [],
                                                    "after": []
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}/events": {
            "get": {
                "operationId": "cyclesEvents",
                "summary": "Change log",
                "description": "History of the recurring project: created, template and schedule changes, pause, periods started, due dates shifted.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_events",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "payload": {
                                                        "type": "object",
                                                        "properties": {
                                                            "period": {
                                                                "type": "string"
                                                            },
                                                            "days": {
                                                                "type": "integer"
                                                            },
                                                            "tasks": {
                                                                "type": "integer"
                                                            },
                                                            "cascade": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 41,
                                            "type": "shifted",
                                            "payload": {
                                                "period": "2026-11",
                                                "days": 2,
                                                "tasks": 6,
                                                "cascade": true
                                            },
                                            "user": {
                                                "id": 311,
                                                "name": "Aigerim Sadykova"
                                            },
                                            "at": "2026-11-30T12:00:00+05:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}/periods": {
            "get": {
                "operationId": "cyclesPeriods",
                "summary": "List periods",
                "description": "Period projects, newest first: progress, tasks done late, overdue now, when the period was closed and how many working days after (+) or before (−) the planned finish (the latest due date of its tasks).",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_periods",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "project_uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "period": {
                                                        "type": "string"
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "anchor": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "total": {
                                                        "type": "integer"
                                                    },
                                                    "done": {
                                                        "type": "integer"
                                                    },
                                                    "progress": {
                                                        "type": "integer"
                                                    },
                                                    "done_late": {
                                                        "type": "integer"
                                                    },
                                                    "overdue": {
                                                        "type": "integer"
                                                    },
                                                    "on_time": {
                                                        "type": "integer"
                                                    },
                                                    "planned": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "finished": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "finish_delta": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "project_uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "CLS2611",
                                            "period": "2026-11",
                                            "label": "November 2026",
                                            "anchor": "2026-11-30",
                                            "status": "active",
                                            "total": 19,
                                            "done": 19,
                                            "progress": 100,
                                            "done_late": 3,
                                            "overdue": 0,
                                            "on_time": 84,
                                            "planned": "2026-12-10",
                                            "finished": "2026-12-08",
                                            "finish_delta": -2
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}/preview": {
            "post": {
                "operationId": "cyclesPreview",
                "summary": "Preview a period",
                "description": "Dates of every item for the next period (or `period`), when the project is created, how many tasks it will have, and hints about the template (no due date, no owner, due before a dependency).",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_preview",
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "period": {
                                        "type": "string",
                                        "description": "Period code: `2026-11`, `2026-Q4` or `2026-W45`",
                                        "maxLength": 10
                                    }
                                }
                            },
                            "example": {
                                "period": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "string"
                                                },
                                                "label": {
                                                    "type": "string"
                                                },
                                                "anchor": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "create_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "exists": {
                                                    "type": "boolean"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "start": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "due": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "tasks": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "tasks": {
                                                    "type": "integer"
                                                },
                                                "warnings": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "item": {
                                                                "type": "string"
                                                            },
                                                            "kind": {
                                                                "type": "string"
                                                            },
                                                            "text": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "schedule_text": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "period": "2026-12",
                                        "label": "December 2026",
                                        "anchor": "2026-12-31",
                                        "create_at": "2026-12-24T04:00:00+00:00",
                                        "exists": false,
                                        "items": [
                                            {
                                                "id": "i_k2m9qa",
                                                "start": null,
                                                "due": "2026-12-30",
                                                "tasks": 4
                                            }
                                        ],
                                        "tasks": 31,
                                        "warnings": [
                                            {
                                                "item": "i_p8x1za",
                                                "kind": "no_assignee",
                                                "text": "No owner"
                                            }
                                        ],
                                        "schedule_text": "every month, by the last day"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}/rankings": {
            "get": {
                "operationId": "cyclesRankings",
                "summary": "Delay rankings",
                "description": "Who is late most often over the last `periods` periods: locations, teams, people and items, with the share of late tasks and the average delay in working days.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_rankings",
                "x-plan-feature": "project_cycles",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "periods",
                        "in": "query",
                        "description": "How many recent periods to count",
                        "schema": {
                            "type": "integer",
                            "default": 6,
                            "minimum": 1,
                            "maximum": 24
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "periods": {
                                                    "type": "integer"
                                                },
                                                "locations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "late": {
                                                                "type": "integer"
                                                            },
                                                            "late_days": {
                                                                "type": "integer"
                                                            },
                                                            "rate": {
                                                                "type": "integer"
                                                            },
                                                            "avg_days": {
                                                                "type": "number"
                                                            }
                                                        }
                                                    }
                                                },
                                                "teams": {
                                                    "type": "array"
                                                },
                                                "people": {
                                                    "type": "array"
                                                },
                                                "items": {
                                                    "type": "array"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "periods": 6,
                                        "locations": [
                                            {
                                                "id": "12",
                                                "label": "Abay 10",
                                                "total": 54,
                                                "late": 9,
                                                "late_days": 21,
                                                "rate": 17,
                                                "avg_days": 2.3
                                            }
                                        ],
                                        "teams": [],
                                        "people": [],
                                        "items": []
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/project-cycles/{uuid}/run": {
            "post": {
                "operationId": "cyclesRun",
                "summary": "Start a period now",
                "description": "Creates the project of the next period (or of `period`) right away instead of waiting for the schedule. Returns the period project. Requires the admin role in the recurring project.",
                "tags": [
                    "Recurring projects"
                ],
                "x-mcp-tool": "cycles_run",
                "x-plan-feature": "project_cycles",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Recurring project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "period": {
                                        "type": "string",
                                        "description": "Period code; default — the next period not created yet",
                                        "maxLength": 10
                                    }
                                }
                            },
                            "example": {
                                "period": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "project_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "period": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "project_uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "key": "CLS2612",
                                        "name": "Month-end closing · December 2026",
                                        "period": "2026-12",
                                        "url": "https://app.jecheck.io/ui/projects/8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects": {
            "get": {
                "operationId": "projectsList",
                "summary": "List projects",
                "description": "Projects the token can open: where it is a member or owner, projects open to the whole company, and with `projects.manage` — all projects. Ordered by status (active first), then by last change.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_list",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting from 1",
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (max 100)",
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "status[]",
                        "in": "query",
                        "description": "Filter by status: active, paused, done, archived",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "style": "form",
                        "explode": true
                    },
                    {
                        "name": "starred",
                        "in": "query",
                        "description": "Only projects starred by the acting user",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "member",
                        "in": "query",
                        "description": "Only projects where the acting user is a member or owner",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search in name and key",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "uuid": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "health": {
                                                        "type": "string"
                                                    },
                                                    "visibility": {
                                                        "type": "string"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "due_date": {
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "owner": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "role": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "stats": {
                                                        "type": "object",
                                                        "properties": {
                                                            "total": {
                                                                "type": "integer"
                                                            },
                                                            "done": {
                                                                "type": "integer"
                                                            },
                                                            "open": {
                                                                "type": "integer"
                                                            },
                                                            "overdue": {
                                                                "type": "integer"
                                                            },
                                                            "progress": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "members_count": {
                                                        "type": "integer"
                                                    },
                                                    "guests_count": {
                                                        "type": "integer"
                                                    },
                                                    "starred": {
                                                        "type": "boolean"
                                                    },
                                                    "last_update_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 58,
                                            "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "OPEN",
                                            "name": "Opening: Abay Ave",
                                            "description": "Launch of the new coffee shop on Abay Ave.",
                                            "icon": "rocket_launch",
                                            "color": "#5b54e8",
                                            "status": "active",
                                            "health": "on_track",
                                            "visibility": "members",
                                            "start_date": "2026-11-01",
                                            "due_date": "2026-12-15",
                                            "owner": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "role": "admin",
                                            "created_at": "2026-10-28T09:00:00+05:00",
                                            "updated_at": "2026-11-03T12:10:00+05:00",
                                            "url": "https://app.jecheck.io/ui/projects/8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "stats": {
                                                "total": 42,
                                                "done": 18,
                                                "open": 23,
                                                "overdue": 3,
                                                "progress": 44
                                            },
                                            "members_count": 6,
                                            "guests_count": 1,
                                            "starred": true,
                                            "last_update_at": "2026-11-02T18:00:00+05:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "operationId": "projectsCreate",
                "summary": "Create a project",
                "description": "Creates a project, empty or from a template (see `projects.templates.list`). The creator and the owner become project admins. Requires `projects.create`.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_create",
                "x-permissions": [
                    "projects.create"
                ],
                "x-scope": "write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Project name",
                                        "minLength": 2,
                                        "maxLength": 200
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "Task number prefix: 2–10 Latin letters/digits starting with a letter (e.g. `OPEN`). Generated from the name if omitted",
                                        "maxLength": 10
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Description",
                                        "maxLength": 20000
                                    },
                                    "icon": {
                                        "type": "string",
                                        "description": "Material Symbols icon name, e.g. `rocket_launch`",
                                        "maxLength": 40
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color, e.g. `#5b54e8`",
                                        "maxLength": 9
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "members",
                                            "company"
                                        ],
                                        "description": "`members` — only members see the project; `company` — every employee can open it and join"
                                    },
                                    "start_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Start date"
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Due date"
                                    },
                                    "owner_id": {
                                        "type": "integer",
                                        "description": "Owner (user id); always an admin of the project"
                                    },
                                    "template": {
                                        "type": "string",
                                        "description": "Template id: a built-in template key or a company template UUID",
                                        "maxLength": 64
                                    },
                                    "members": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer",
                                                    "description": "User id"
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "enum": [
                                                        "admin",
                                                        "editor",
                                                        "commenter",
                                                        "viewer"
                                                    ],
                                                    "description": "Project role, default `editor`"
                                                }
                                            },
                                            "required": [
                                                "user_id"
                                            ]
                                        },
                                        "description": "Members to add",
                                        "maxItems": 200
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "key": "string",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "icon": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "health": {
                                                    "type": "string"
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "due_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "starred": {
                                                    "type": "boolean"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "guest_scope": {
                                                            "type": "string"
                                                        },
                                                        "time_tracking": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "comment": {
                                                            "type": "boolean"
                                                        },
                                                        "manage": {
                                                            "type": "boolean"
                                                        },
                                                        "invite_guests": {
                                                            "type": "boolean"
                                                        },
                                                        "join": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "columns": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "color": {
                                                                "type": "string"
                                                            },
                                                            "wip_limit": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "milestones": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "done": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "options": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "label": {
                                                                            "type": "string"
                                                                        },
                                                                        "color": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "on_card": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "guests": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "company": {
                                                                "type": "string"
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            },
                                                            "tasks_count": {
                                                                "type": "integer"
                                                            },
                                                            "last_seen_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "invited_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "stats": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "open": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "unassigned": {
                                                            "type": "integer"
                                                        },
                                                        "progress": {
                                                            "type": "integer"
                                                        },
                                                        "forecast": {
                                                            "type": "string",
                                                            "format": "date"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 58,
                                        "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "key": "OPEN",
                                        "name": "Opening: Abay Ave",
                                        "description": "Launch of the new coffee shop on Abay Ave.",
                                        "icon": "rocket_launch",
                                        "color": "#5b54e8",
                                        "status": "active",
                                        "health": "on_track",
                                        "visibility": "members",
                                        "start_date": "2026-11-01",
                                        "due_date": "2026-12-15",
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "role": "admin",
                                        "created_at": "2026-10-28T09:00:00+05:00",
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "completed_at": null,
                                        "starred": true,
                                        "settings": {
                                            "guest_scope": "all",
                                            "time_tracking": true
                                        },
                                        "permissions": {
                                            "edit": true,
                                            "comment": true,
                                            "manage": true,
                                            "invite_guests": true,
                                            "join": false
                                        },
                                        "sections": [
                                            {
                                                "id": 201,
                                                "name": "Equipment"
                                            }
                                        ],
                                        "columns": [
                                            {
                                                "id": 301,
                                                "name": "In progress",
                                                "status": "in_progress",
                                                "color": "#f59e0b",
                                                "wip_limit": 5
                                            }
                                        ],
                                        "milestones": [
                                            {
                                                "id": 401,
                                                "title": "Soft opening",
                                                "description": "",
                                                "due_date": "2026-12-01",
                                                "done": false
                                            }
                                        ],
                                        "fields": [
                                            {
                                                "id": 501,
                                                "name": "Supplier",
                                                "type": "select",
                                                "options": [
                                                    {
                                                        "id": "o_k2m9qa",
                                                        "label": "Metro",
                                                        "color": "#22c55e"
                                                    }
                                                ],
                                                "on_card": true
                                            }
                                        ],
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "role": "admin"
                                            }
                                        ],
                                        "guests": [
                                            {
                                                "id": 12,
                                                "name": "Ivan Petrov",
                                                "email": "ivan@buildco.kz",
                                                "company": "BuildCo",
                                                "role": "editor",
                                                "tasks_count": 4,
                                                "last_seen_at": "2026-11-02T15:30:00+05:00",
                                                "invited_at": "2026-10-29T10:00:00+05:00",
                                                "url": "https://app.jecheck.io/pg/Ab12Cd34Ef56Gh78Ij90Kl12Mn34Op56"
                                            }
                                        ],
                                        "stats": {
                                            "total": 42,
                                            "done": 18,
                                            "open": 23,
                                            "overdue": 3,
                                            "unassigned": 2,
                                            "progress": 44,
                                            "forecast": "2026-12-20"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/tasks/{uuid}": {
            "get": {
                "operationId": "projectsTasksGet",
                "summary": "Get the project part of a task",
                "description": "Project-specific data of a task: section, column, milestone, custom field values, guests, links to other tasks and time logs.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_tasks_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID (the task must belong to a project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "task_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "project": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "section_id": {
                                                    "type": "integer"
                                                },
                                                "column_id": {
                                                    "type": "integer"
                                                },
                                                "milestone_id": {
                                                    "type": "integer"
                                                },
                                                "fields": {
                                                    "type": "object",
                                                    "properties": {
                                                        "501": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "guest_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "task": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    },
                                                                    "due_date": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "time_logs": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "minutes": {
                                                                "type": "integer"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "note": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "guest_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "spent_minutes": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "project": {
                                            "id": 58,
                                            "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "OPEN",
                                            "name": "Opening: Abay Ave"
                                        },
                                        "role": "editor",
                                        "section_id": 201,
                                        "column_id": 301,
                                        "milestone_id": 401,
                                        "fields": {
                                            "501": "o_k2m9qa"
                                        },
                                        "guest_ids": [
                                            12
                                        ],
                                        "links": [
                                            {
                                                "id": 77,
                                                "type": "blocked_by",
                                                "task": {
                                                    "uuid": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
                                                    "key": "OPEN-9",
                                                    "title": "Deliver the machine",
                                                    "status": "done",
                                                    "due_date": "2026-11-05"
                                                }
                                            }
                                        ],
                                        "time_logs": [
                                            {
                                                "id": 901,
                                                "minutes": 90,
                                                "date": "2026-11-03",
                                                "note": "Plumbing",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "guest_name": null
                                            }
                                        ],
                                        "spent_minutes": 90
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "projectsTasksUpdate",
                "summary": "Update the project part of a task",
                "description": "Sets section, milestone, board column, custom field values (`fields`: field id → value; `null` clears; select — option id, multiselect — array of option ids, user — user id) and assigned guests. Requires the editor role.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_tasks_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID (the task must belong to a project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "section_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "milestone_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "column_id": {
                                        "type": "integer",
                                        "description": "Board column (changes the status as on the board)"
                                    },
                                    "fields": {
                                        "type": "object",
                                        "properties": {},
                                        "additionalProperties": true,
                                        "description": "Custom field values: {\"<field id>\": value}"
                                    },
                                    "guest_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Project guests assigned to the task (replaces the list)",
                                        "maxItems": 20
                                    }
                                }
                            },
                            "example": {
                                "section_id": 42,
                                "milestone_id": 42,
                                "column_id": 42,
                                "fields": []
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "task_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "project": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "section_id": {
                                                    "type": "integer"
                                                },
                                                "column_id": {
                                                    "type": "integer"
                                                },
                                                "milestone_id": {
                                                    "type": "integer"
                                                },
                                                "fields": {
                                                    "type": "object",
                                                    "properties": {
                                                        "501": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "guest_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "task": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    },
                                                                    "due_date": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "time_logs": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "minutes": {
                                                                "type": "integer"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "note": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "guest_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "spent_minutes": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "project": {
                                            "id": 58,
                                            "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "OPEN",
                                            "name": "Opening: Abay Ave"
                                        },
                                        "role": "editor",
                                        "section_id": 201,
                                        "column_id": 301,
                                        "milestone_id": 401,
                                        "fields": {
                                            "501": "o_k2m9qa"
                                        },
                                        "guest_ids": [
                                            12
                                        ],
                                        "links": [
                                            {
                                                "id": 77,
                                                "type": "blocked_by",
                                                "task": {
                                                    "uuid": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
                                                    "key": "OPEN-9",
                                                    "title": "Deliver the machine",
                                                    "status": "done",
                                                    "due_date": "2026-11-05"
                                                }
                                            }
                                        ],
                                        "time_logs": [
                                            {
                                                "id": 901,
                                                "minutes": 90,
                                                "date": "2026-11-03",
                                                "note": "Plumbing",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "guest_name": null
                                            }
                                        ],
                                        "spent_minutes": 90
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/tasks/{uuid}/links": {
            "post": {
                "operationId": "projectsTasksLinksCreate",
                "summary": "Link two tasks",
                "description": "Adds a dependency or relation: `blocks`, `blocked_by`, `relates`, `duplicates`. Cycles of `blocks` are rejected.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_tasks_links_create",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID (the task must belong to a project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "other_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The other task UUID"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "blocks",
                                            "blocked_by",
                                            "relates",
                                            "duplicates"
                                        ]
                                    }
                                },
                                "required": [
                                    "other_uuid",
                                    "type"
                                ]
                            },
                            "example": {
                                "other_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                "type": "blocks"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "task_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "project": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "section_id": {
                                                    "type": "integer"
                                                },
                                                "column_id": {
                                                    "type": "integer"
                                                },
                                                "milestone_id": {
                                                    "type": "integer"
                                                },
                                                "fields": {
                                                    "type": "object",
                                                    "properties": {
                                                        "501": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "guest_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "task": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    },
                                                                    "due_date": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "time_logs": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "minutes": {
                                                                "type": "integer"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "note": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "guest_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "spent_minutes": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "project": {
                                            "id": 58,
                                            "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "OPEN",
                                            "name": "Opening: Abay Ave"
                                        },
                                        "role": "editor",
                                        "section_id": 201,
                                        "column_id": 301,
                                        "milestone_id": 401,
                                        "fields": {
                                            "501": "o_k2m9qa"
                                        },
                                        "guest_ids": [
                                            12
                                        ],
                                        "links": [
                                            {
                                                "id": 77,
                                                "type": "blocked_by",
                                                "task": {
                                                    "uuid": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
                                                    "key": "OPEN-9",
                                                    "title": "Deliver the machine",
                                                    "status": "done",
                                                    "due_date": "2026-11-05"
                                                }
                                            }
                                        ],
                                        "time_logs": [
                                            {
                                                "id": 901,
                                                "minutes": 90,
                                                "date": "2026-11-03",
                                                "note": "Plumbing",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "guest_name": null
                                            }
                                        ],
                                        "spent_minutes": 90
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/tasks/{uuid}/links/{id}": {
            "delete": {
                "operationId": "projectsTasksLinksDelete",
                "summary": "Remove a task link",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_tasks_links_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID (the task must belong to a project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Link id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/tasks/{uuid}/time": {
            "post": {
                "operationId": "projectsTasksTimeCreate",
                "summary": "Log time on a task",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_tasks_time_create",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID (the task must belong to a project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "minutes": {
                                        "type": "integer",
                                        "description": "Minutes spent (1–1440)",
                                        "minimum": 1,
                                        "maximum": 1440
                                    },
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Day of work, default today"
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Note",
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "minutes"
                                ]
                            },
                            "example": {
                                "minutes": 42,
                                "date": "2026-11-01",
                                "note": "Seal on fridge #2 is torn, temperature rises to +9 °C."
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "task_uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "project": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "section_id": {
                                                    "type": "integer"
                                                },
                                                "column_id": {
                                                    "type": "integer"
                                                },
                                                "milestone_id": {
                                                    "type": "integer"
                                                },
                                                "fields": {
                                                    "type": "object",
                                                    "properties": {
                                                        "501": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "guest_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "task": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "key": {
                                                                        "type": "string"
                                                                    },
                                                                    "title": {
                                                                        "type": "string"
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    },
                                                                    "due_date": {
                                                                        "type": "string",
                                                                        "format": "date"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                },
                                                "time_logs": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "minutes": {
                                                                "type": "integer"
                                                            },
                                                            "date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "note": {
                                                                "type": "string"
                                                            },
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "guest_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "spent_minutes": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "task_uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                        "project": {
                                            "id": 58,
                                            "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                            "key": "OPEN",
                                            "name": "Opening: Abay Ave"
                                        },
                                        "role": "editor",
                                        "section_id": 201,
                                        "column_id": 301,
                                        "milestone_id": 401,
                                        "fields": {
                                            "501": "o_k2m9qa"
                                        },
                                        "guest_ids": [
                                            12
                                        ],
                                        "links": [
                                            {
                                                "id": 77,
                                                "type": "blocked_by",
                                                "task": {
                                                    "uuid": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
                                                    "key": "OPEN-9",
                                                    "title": "Deliver the machine",
                                                    "status": "done",
                                                    "due_date": "2026-11-05"
                                                }
                                            }
                                        ],
                                        "time_logs": [
                                            {
                                                "id": 901,
                                                "minutes": 90,
                                                "date": "2026-11-03",
                                                "note": "Plumbing",
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "guest_name": null
                                            }
                                        ],
                                        "spent_minutes": 90
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/tasks/{uuid}/time/{id}": {
            "delete": {
                "operationId": "projectsTasksTimeDelete",
                "summary": "Delete a time log",
                "description": "Own time logs can be deleted by their author; any — by project admins.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_tasks_time_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Task UUID (the task must belong to a project)",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Time log id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/templates": {
            "get": {
                "operationId": "projectsTemplatesList",
                "summary": "List project templates",
                "description": "Built-in templates and the company's own templates (saved from projects). Pass the template `id` as `template` when creating a project. Company templates are listed only with `projects.create`.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_templates_list",
                "x-scope": "read",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "company": {
                                                        "type": "boolean"
                                                    },
                                                    "tasks_count": {
                                                        "type": "integer"
                                                    },
                                                    "days": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": "opening",
                                            "name": "Opening a new location",
                                            "description": "Everything from lease to soft opening",
                                            "icon": "storefront",
                                            "company": false,
                                            "tasks_count": 34,
                                            "days": 60
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/templates/{template_uuid}": {
            "delete": {
                "operationId": "projectsTemplatesDelete",
                "summary": "Delete a company template",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_templates_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "template_uuid",
                        "in": "path",
                        "required": true,
                        "description": "Company template UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/{uuid}": {
            "get": {
                "operationId": "projectsGet",
                "summary": "Retrieve a project",
                "description": "Project card with the acting user's role and permissions, sections, board columns, milestones, custom fields, members, guests (only for project admins with `projects.guests`) and progress figures.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_get",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "health": {
                                                    "type": "string"
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "due_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "starred": {
                                                    "type": "boolean"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "guest_scope": {
                                                            "type": "string"
                                                        },
                                                        "time_tracking": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "comment": {
                                                            "type": "boolean"
                                                        },
                                                        "manage": {
                                                            "type": "boolean"
                                                        },
                                                        "invite_guests": {
                                                            "type": "boolean"
                                                        },
                                                        "join": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "columns": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "color": {
                                                                "type": "string"
                                                            },
                                                            "wip_limit": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "milestones": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "done": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "options": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "label": {
                                                                            "type": "string"
                                                                        },
                                                                        "color": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "on_card": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "guests": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "company": {
                                                                "type": "string"
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            },
                                                            "tasks_count": {
                                                                "type": "integer"
                                                            },
                                                            "last_seen_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "invited_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "stats": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "open": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "unassigned": {
                                                            "type": "integer"
                                                        },
                                                        "progress": {
                                                            "type": "integer"
                                                        },
                                                        "forecast": {
                                                            "type": "string",
                                                            "format": "date"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 58,
                                        "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "key": "OPEN",
                                        "name": "Opening: Abay Ave",
                                        "description": "Launch of the new coffee shop on Abay Ave.",
                                        "icon": "rocket_launch",
                                        "color": "#5b54e8",
                                        "status": "active",
                                        "health": "on_track",
                                        "visibility": "members",
                                        "start_date": "2026-11-01",
                                        "due_date": "2026-12-15",
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "role": "admin",
                                        "created_at": "2026-10-28T09:00:00+05:00",
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "completed_at": null,
                                        "starred": true,
                                        "settings": {
                                            "guest_scope": "all",
                                            "time_tracking": true
                                        },
                                        "permissions": {
                                            "edit": true,
                                            "comment": true,
                                            "manage": true,
                                            "invite_guests": true,
                                            "join": false
                                        },
                                        "sections": [
                                            {
                                                "id": 201,
                                                "name": "Equipment"
                                            }
                                        ],
                                        "columns": [
                                            {
                                                "id": 301,
                                                "name": "In progress",
                                                "status": "in_progress",
                                                "color": "#f59e0b",
                                                "wip_limit": 5
                                            }
                                        ],
                                        "milestones": [
                                            {
                                                "id": 401,
                                                "title": "Soft opening",
                                                "description": "",
                                                "due_date": "2026-12-01",
                                                "done": false
                                            }
                                        ],
                                        "fields": [
                                            {
                                                "id": 501,
                                                "name": "Supplier",
                                                "type": "select",
                                                "options": [
                                                    {
                                                        "id": "o_k2m9qa",
                                                        "label": "Metro",
                                                        "color": "#22c55e"
                                                    }
                                                ],
                                                "on_card": true
                                            }
                                        ],
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "role": "admin"
                                            }
                                        ],
                                        "guests": [
                                            {
                                                "id": 12,
                                                "name": "Ivan Petrov",
                                                "email": "ivan@buildco.kz",
                                                "company": "BuildCo",
                                                "role": "editor",
                                                "tasks_count": 4,
                                                "last_seen_at": "2026-11-02T15:30:00+05:00",
                                                "invited_at": "2026-10-29T10:00:00+05:00",
                                                "url": "https://app.jecheck.io/pg/Ab12Cd34Ef56Gh78Ij90Kl12Mn34Op56"
                                            }
                                        ],
                                        "stats": {
                                            "total": 42,
                                            "done": 18,
                                            "open": 23,
                                            "overdue": 3,
                                            "unassigned": 2,
                                            "progress": 44,
                                            "forecast": "2026-12-20"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "operationId": "projectsUpdate",
                "summary": "Update a project",
                "description": "Partial update of project settings. Requires the admin role in the project (or `projects.manage`). Setting `status` to `done` stamps the completion time.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_update",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Project name",
                                        "minLength": 2,
                                        "maxLength": 200
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "Task number prefix: 2–10 Latin letters/digits starting with a letter (e.g. `OPEN`). Generated from the name if omitted",
                                        "maxLength": 10
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Description",
                                        "maxLength": 20000
                                    },
                                    "icon": {
                                        "type": "string",
                                        "description": "Material Symbols icon name, e.g. `rocket_launch`",
                                        "maxLength": 40
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Hex color, e.g. `#5b54e8`",
                                        "maxLength": 9
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "members",
                                            "company"
                                        ],
                                        "description": "`members` — only members see the project; `company` — every employee can open it and join"
                                    },
                                    "start_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Start date"
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date",
                                        "description": "Due date"
                                    },
                                    "owner_id": {
                                        "type": "integer",
                                        "description": "Owner (user id); always an admin of the project"
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "active",
                                            "paused",
                                            "done",
                                            "archived"
                                        ],
                                        "description": "Project status"
                                    },
                                    "health": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "on_track",
                                            "at_risk",
                                            "off_track"
                                        ],
                                        "description": "Health indicator"
                                    },
                                    "guest_scope": {
                                        "type": "string",
                                        "enum": [
                                            "all",
                                            "assigned"
                                        ],
                                        "description": "What guests see: all tasks or only tasks assigned to them"
                                    },
                                    "time_tracking": {
                                        "type": "boolean",
                                        "description": "Enable time logging in tasks"
                                    }
                                }
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "key": "string",
                                "description": "Seal on fridge #2 is torn, temperature rises to +9 °C.",
                                "icon": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "health": {
                                                    "type": "string"
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "due_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "starred": {
                                                    "type": "boolean"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "guest_scope": {
                                                            "type": "string"
                                                        },
                                                        "time_tracking": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "comment": {
                                                            "type": "boolean"
                                                        },
                                                        "manage": {
                                                            "type": "boolean"
                                                        },
                                                        "invite_guests": {
                                                            "type": "boolean"
                                                        },
                                                        "join": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "columns": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "color": {
                                                                "type": "string"
                                                            },
                                                            "wip_limit": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "milestones": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "done": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "options": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "label": {
                                                                            "type": "string"
                                                                        },
                                                                        "color": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "on_card": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "guests": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "company": {
                                                                "type": "string"
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            },
                                                            "tasks_count": {
                                                                "type": "integer"
                                                            },
                                                            "last_seen_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "invited_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "stats": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "open": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "unassigned": {
                                                            "type": "integer"
                                                        },
                                                        "progress": {
                                                            "type": "integer"
                                                        },
                                                        "forecast": {
                                                            "type": "string",
                                                            "format": "date"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 58,
                                        "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "key": "OPEN",
                                        "name": "Opening: Abay Ave",
                                        "description": "Launch of the new coffee shop on Abay Ave.",
                                        "icon": "rocket_launch",
                                        "color": "#5b54e8",
                                        "status": "active",
                                        "health": "on_track",
                                        "visibility": "members",
                                        "start_date": "2026-11-01",
                                        "due_date": "2026-12-15",
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "role": "admin",
                                        "created_at": "2026-10-28T09:00:00+05:00",
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "completed_at": null,
                                        "starred": true,
                                        "settings": {
                                            "guest_scope": "all",
                                            "time_tracking": true
                                        },
                                        "permissions": {
                                            "edit": true,
                                            "comment": true,
                                            "manage": true,
                                            "invite_guests": true,
                                            "join": false
                                        },
                                        "sections": [
                                            {
                                                "id": 201,
                                                "name": "Equipment"
                                            }
                                        ],
                                        "columns": [
                                            {
                                                "id": 301,
                                                "name": "In progress",
                                                "status": "in_progress",
                                                "color": "#f59e0b",
                                                "wip_limit": 5
                                            }
                                        ],
                                        "milestones": [
                                            {
                                                "id": 401,
                                                "title": "Soft opening",
                                                "description": "",
                                                "due_date": "2026-12-01",
                                                "done": false
                                            }
                                        ],
                                        "fields": [
                                            {
                                                "id": 501,
                                                "name": "Supplier",
                                                "type": "select",
                                                "options": [
                                                    {
                                                        "id": "o_k2m9qa",
                                                        "label": "Metro",
                                                        "color": "#22c55e"
                                                    }
                                                ],
                                                "on_card": true
                                            }
                                        ],
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "role": "admin"
                                            }
                                        ],
                                        "guests": [
                                            {
                                                "id": 12,
                                                "name": "Ivan Petrov",
                                                "email": "ivan@buildco.kz",
                                                "company": "BuildCo",
                                                "role": "editor",
                                                "tasks_count": 4,
                                                "last_seen_at": "2026-11-02T15:30:00+05:00",
                                                "invited_at": "2026-10-29T10:00:00+05:00",
                                                "url": "https://app.jecheck.io/pg/Ab12Cd34Ef56Gh78Ij90Kl12Mn34Op56"
                                            }
                                        ],
                                        "stats": {
                                            "total": 42,
                                            "done": 18,
                                            "open": 23,
                                            "overdue": 3,
                                            "unassigned": 2,
                                            "progress": 44,
                                            "forecast": "2026-12-20"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "operationId": "projectsDelete",
                "summary": "Delete a project",
                "description": "Deletes the project together with its tasks (soft delete) and revokes guest links. Requires the admin role in the project.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_delete",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "deleted": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/{uuid}/activity": {
            "get": {
                "operationId": "projectsActivity",
                "summary": "List project activity",
                "description": "Latest project and task events (up to 60), newest first. Page back with `before` = `at` of the last event.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_activity",
                "x-scope": "read",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "before",
                        "in": "query",
                        "description": "Only events before this moment",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "scope": {
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "guest_name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "payload": {
                                                        "type": "object",
                                                        "properties": {
                                                            "from": {
                                                                "type": "string"
                                                            },
                                                            "to": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "task": {
                                                        "type": "object",
                                                        "properties": {
                                                            "uuid": {
                                                                "type": "string",
                                                                "format": "uuid"
                                                            },
                                                            "key": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "scope": "task",
                                            "type": "status",
                                            "user": {
                                                "id": 311,
                                                "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                "name": "Aigerim Sadykova"
                                            },
                                            "guest_name": null,
                                            "payload": {
                                                "from": "new",
                                                "to": "in_progress"
                                            },
                                            "task": {
                                                "uuid": "3f2b8c1e-7a4d-4e2f-9b1a-6c5d4e3f2a1b",
                                                "key": "OPEN-12",
                                                "title": "Install the espresso machine"
                                            },
                                            "at": "2026-11-03T12:01:00+05:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/{uuid}/archive": {
            "post": {
                "operationId": "projectsArchive",
                "summary": "Archive a project",
                "description": "Moves the project to the archive (status `archived`). Restore it with `projects.update` and `status: active`. Requires the admin role in the project.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_archive",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "key": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "icon": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "health": {
                                                    "type": "string"
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "due_date": {
                                                    "type": "string",
                                                    "format": "date"
                                                },
                                                "owner": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "uuid": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "starred": {
                                                    "type": "boolean"
                                                },
                                                "settings": {
                                                    "type": "object",
                                                    "properties": {
                                                        "guest_scope": {
                                                            "type": "string"
                                                        },
                                                        "time_tracking": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "permissions": {
                                                    "type": "object",
                                                    "properties": {
                                                        "edit": {
                                                            "type": "boolean"
                                                        },
                                                        "comment": {
                                                            "type": "boolean"
                                                        },
                                                        "manage": {
                                                            "type": "boolean"
                                                        },
                                                        "invite_guests": {
                                                            "type": "boolean"
                                                        },
                                                        "join": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "sections": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "columns": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "color": {
                                                                "type": "string"
                                                            },
                                                            "wip_limit": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    }
                                                },
                                                "milestones": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "description": {
                                                                "type": "string"
                                                            },
                                                            "due_date": {
                                                                "type": "string",
                                                                "format": "date"
                                                            },
                                                            "done": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "options": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "string"
                                                                        },
                                                                        "label": {
                                                                            "type": "string"
                                                                        },
                                                                        "color": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                }
                                                            },
                                                            "on_card": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "user": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer"
                                                                    },
                                                                    "uuid": {
                                                                        "type": "string",
                                                                        "format": "uuid"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                },
                                                "guests": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "company": {
                                                                "type": "string"
                                                            },
                                                            "role": {
                                                                "type": "string"
                                                            },
                                                            "tasks_count": {
                                                                "type": "integer"
                                                            },
                                                            "last_seen_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "invited_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "url": {
                                                                "type": "string",
                                                                "format": "uri"
                                                            }
                                                        }
                                                    }
                                                },
                                                "stats": {
                                                    "type": "object",
                                                    "properties": {
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "done": {
                                                            "type": "integer"
                                                        },
                                                        "open": {
                                                            "type": "integer"
                                                        },
                                                        "overdue": {
                                                            "type": "integer"
                                                        },
                                                        "unassigned": {
                                                            "type": "integer"
                                                        },
                                                        "progress": {
                                                            "type": "integer"
                                                        },
                                                        "forecast": {
                                                            "type": "string",
                                                            "format": "date"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 58,
                                        "uuid": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "key": "OPEN",
                                        "name": "Opening: Abay Ave",
                                        "description": "Launch of the new coffee shop on Abay Ave.",
                                        "icon": "rocket_launch",
                                        "color": "#5b54e8",
                                        "status": "active",
                                        "health": "on_track",
                                        "visibility": "members",
                                        "start_date": "2026-11-01",
                                        "due_date": "2026-12-15",
                                        "owner": {
                                            "id": 311,
                                            "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                            "name": "Aigerim Sadykova"
                                        },
                                        "role": "admin",
                                        "created_at": "2026-10-28T09:00:00+05:00",
                                        "updated_at": "2026-11-03T12:10:00+05:00",
                                        "url": "https://app.jecheck.io/ui/projects/8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                                        "completed_at": null,
                                        "starred": true,
                                        "settings": {
                                            "guest_scope": "all",
                                            "time_tracking": true
                                        },
                                        "permissions": {
                                            "edit": true,
                                            "comment": true,
                                            "manage": true,
                                            "invite_guests": true,
                                            "join": false
                                        },
                                        "sections": [
                                            {
                                                "id": 201,
                                                "name": "Equipment"
                                            }
                                        ],
                                        "columns": [
                                            {
                                                "id": 301,
                                                "name": "In progress",
                                                "status": "in_progress",
                                                "color": "#f59e0b",
                                                "wip_limit": 5
                                            }
                                        ],
                                        "milestones": [
                                            {
                                                "id": 401,
                                                "title": "Soft opening",
                                                "description": "",
                                                "due_date": "2026-12-01",
                                                "done": false
                                            }
                                        ],
                                        "fields": [
                                            {
                                                "id": 501,
                                                "name": "Supplier",
                                                "type": "select",
                                                "options": [
                                                    {
                                                        "id": "o_k2m9qa",
                                                        "label": "Metro",
                                                        "color": "#22c55e"
                                                    }
                                                ],
                                                "on_card": true
                                            }
                                        ],
                                        "members": [
                                            {
                                                "user": {
                                                    "id": 311,
                                                    "uuid": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
                                                    "name": "Aigerim Sadykova"
                                                },
                                                "role": "admin"
                                            }
                                        ],
                                        "guests": [
                                            {
                                                "id": 12,
                                                "name": "Ivan Petrov",
                                                "email": "ivan@buildco.kz",
                                                "company": "BuildCo",
                                                "role": "editor",
                                                "tasks_count": 4,
                                                "last_seen_at": "2026-11-02T15:30:00+05:00",
                                                "invited_at": "2026-10-29T10:00:00+05:00",
                                                "url": "https://app.jecheck.io/pg/Ab12Cd34Ef56Gh78Ij90Kl12Mn34Op56"
                                            }
                                        ],
                                        "stats": {
                                            "total": 42,
                                            "done": 18,
                                            "open": 23,
                                            "overdue": 3,
                                            "unassigned": 2,
                                            "progress": 44,
                                            "forecast": "2026-12-20"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/{uuid}/columns": {
            "post": {
                "operationId": "projectsColumnsCreate",
                "summary": "Create a column",
                "description": "Adds a column to the project. Requires the admin role in the project.",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_columns_create",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Column name",
                                        "minLength": 1,
                                        "maxLength": 60
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "new",
                                            "in_progress",
                                            "review",
                                            "done",
                                            "rejected"
                                        ],
                                        "description": "Task status the column stands for"
                                    },
                                    "color": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Hex color",
                                        "maxLength": 9
                                    },
                                    "wip_limit": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Work-in-progress limit",
                                        "minimum": 1,
                                        "maximum": 999
                                    }
                                },
                                "required": [
                                    "name",
                                    "status"
                                ]
                            },
                            "example": {
                                "name": "Replace the broken fridge seal",
                                "status": "new",
                                "color": "string",
                                "wip_limit": 42
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "color": {
                                                    "type": "string"
                                                },
                                                "wip_limit": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 301,
                                        "name": "In progress",
                                        "status": "in_progress",
                                        "color": "#f59e0b",
                                        "wip_limit": 5
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/projects/{uuid}/columns/order": {
            "put": {
                "operationId": "projectsColumnsReorder",
                "summary": "Reorder columns",
                "tags": [
                    "Projects"
                ],
                "x-mcp-tool": "projects_columns_reorder",
                "x-scope": "write",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "description": "Project UUID",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "All ids in the new order",
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "ids"
                                ]
                            },
                            "example": {
                                "ids": [
                                    12,
                                    14
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "color": {
                                                        "type": "string"
                                                    },
                                                    "wip_limit": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "